Function peekInt [src]
Asserts the buffer was initialized with a capacity at least @bitSizeOf(T) / 8.
Prototype
pub inline fn peekInt(r: *Reader, comptime T: type, endian: std.builtin.Endian) Error!T
Parameters
r: *Reader
T: type
endian: std.builtin.Endian
Possible Errors
See the Reader
implementation for detailed diagnostics.
Source
pub inline fn peekInt(r: *Reader, comptime T: type, endian: std.builtin.Endian) Error!T {
const n = @divExact(@typeInfo(T).int.bits, 8);
return std.mem.readInt(T, try r.peekArray(n), endian);
}