authorgravatar for dbandstra@protonmail.comdbandstra <dbandstra@protonmail.com> 2018-07-28 17:34:28-07:00
committergravatar for dbandstra@protonmail.comdbandstra <dbandstra@protonmail.com> 2018-07-28 17:34:28-07:00
logf36faa32c46897a12852da9f382ab10979511d6f
treef5838ce24e8f444695a94751e86f5e3eabea821b
parent3ce0ea884f8a64e1173ab814de10b6c33833b3b8

add skipBytes function to InStream

this reads N bytes, discarding their values

1 files changed, 7 insertions(+), 0 deletions(-)

std/io.zig+7
...@@ -200,6 +200,13 @@ pub fn InStream(comptime ReadError: type) type {...@@ -200,6 +200,13 @@ pub fn InStream(comptime ReadError: type) type {
200 try self.readNoEof(input_slice);200 try self.readNoEof(input_slice);
201 return mem.readInt(input_slice, T, endian);201 return mem.readInt(input_slice, T, endian);
202 }202 }
203
204 pub fn skipBytes(self: *Self, num_bytes: usize) !void {
205 var i: usize = 0;
206 while (i < num_bytes) : (i += 1) {
207 _ = try self.readByte();
208 }
209 }
203 };210 };
204}211}
205212