pub fn peekGreedy(r: *Reader, n: usize) Error![]u8
Returns all the next buffered bytes, after filling the buffer to ensure it contains at least n bytes.
n
Invalidates previously returned values from peek and peekGreedy.
peek
peekGreedy
Asserts that the Reader was initialized with a buffer capacity at least as big as n.
Reader
If there are fewer than n bytes left in the stream, error.EndOfStream is returned instead.
error.EndOfStream
See also:
toss
r: *Reader
n: usize
ReadFailed
See the Reader implementation for detailed diagnostics.
EndOfStream
534 535 536 537
pub fn peekGreedy(r: *Reader, n: usize) Error![]u8 { try r.fill(n); return r.buffer[r.seek..r.end]; }
Returns all the next buffered bytes, after filling the buffer to ensure it contains at least
nbytes.Invalidates previously returned values from
peekandpeekGreedy.Asserts that the
Readerwas initialized with a buffer capacity at least as big asn.If there are fewer than
nbytes left in the stream,error.EndOfStreamis returned instead.See also:
peektoss