Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

fill

Fills the buffer such that it contains at least n bytes, without advancing the seek position.

Returns error.EndOfStream if and only if there are fewer than n bytes remaining.

If the end of stream is not encountered, asserts buffer capacity is at least n.

Reader.fill
pub fn fill(r: *Reader, n: usize) Error!void

File

lib/std/Io/Reader.zig:1109

Code

pub fn fill(r: *Reader, n: usize) Error!void {
    if (r.seek + n <= r.end) {
        @branchHint(.likely);
        return;
    }
    return fillUnbuffered(r, n);
}