| ... | @@ -404,3 +404,11 @@ pub fn BufIndexer(comptime T: type, comptime endian: std.builtin.Endian) type { | ... | @@ -404,3 +404,11 @@ pub fn BufIndexer(comptime T: type, comptime endian: std.builtin.Endian) type { |
| 404 | } | 404 | } |
| 405 | }; | 405 | }; |
| 406 | } | 406 | } |
| | 407 | |
| | 408 | pub fn skipToBoundary(pos: u64, boundary: u64, reader: anytype) !void { |
| | 409 | // const gdiff = counter.bytes_read % 4; |
| | 410 | // for (range(if (gdiff > 0) 4 - gdiff else 0)) |_| { |
| | 411 | const a = pos; |
| | 412 | const b = boundary; |
| | 413 | try reader.skipBytes(((a + (b - 1)) & ~(b - 1)) - a, .{}); |
| | 414 | } |