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.

readSliceAll

Fill buffer with the next buffer.len bytes from the stream, advancing the seek position.

Invalidates previously returned values from peek.

If the provided buffer cannot be filled completely, error.EndOfStream is returned instead.

See also:

Reader.readSliceAll
pub fn readSliceAll(r: *Reader, buffer: []u8) Error!void

File

lib/std/Io/Reader.zig:664

Code

pub fn readSliceAll(r: *Reader, buffer: []u8) Error!void {
    const n = try readSliceShort(r, buffer);
    if (n != buffer.len) return error.EndOfStream;
}