Function takeByte [src]
Reads 1 byte from the stream or returns error.EndOfStream.
Asserts the buffer capacity is nonzero.
Prototype
pub fn takeByte(r: *Reader) Error!u8
Parameters
r: *Reader
Possible Errors
See the Reader
implementation for detailed diagnostics.
Example
test takeByte {
var r: Reader = .fixed("ab");
try testing.expectEqual('a', try r.takeByte());
try testing.expectEqual('b', try r.takeByte());
try testing.expectError(error.EndOfStream, r.takeByte());
}
Source
pub fn takeByte(r: *Reader) Error!u8 {
const result = try peekByte(r);
r.seek += 1;
return result;
}