Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

ReadBytes

Collects a complete byte stream into explicit owned storage. Reserves before each read so valid partial provider progress remains owned on failure. Short reads continue until successful zero-byte EOF. Counts are checked before indexing; source failure never discards the already consumed prefix. Geometric storage growth may retain spare capacity beyond the read scratch.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.io

import std.io;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

ReadBytes

pub fn ReadBytes<S>(Source: mut S&) -> Result<Vector<byte>, StreamReadError> where S: Reader

Collects a complete byte stream into explicit owned storage. Reserves before each read so valid partial provider progress remains owned on failure. Short reads continue until successful zero-byte EOF. Counts are checked before indexing; source failure never discards the already consumed prefix. Geometric storage growth may retain spare capacity beyond the read scratch. S: Structural Reader source type. Source: Borrowed mutable stream, retained through completion. Return: owned bytes or failure owning every proven consumed byte. Warning: May allocate and block; consumes until EOF without a fixed total-size bound.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library