Function readInt [src]

Prototype

pub fn readInt(fbr: *FixedBufferReader, comptime T: type) Error!T

Parameters

fbr: *FixedBufferReaderT: type

Possible Errors

EndOfBuffer
InvalidBuffer
Overflow

Source

pub fn readInt(fbr: *FixedBufferReader, comptime T: type) Error!T { const size = @divExact(@typeInfo(T).int.bits, 8); if (fbr.buf.len - fbr.pos < size) return error.EndOfBuffer; defer fbr.pos += size; return std.mem.readInt(T, fbr.buf[fbr.pos..][0..size], fbr.endian); }