stream-read ( n stream -- seq/f )
Factor handbook » Input and output » Streams » Stream protocol

Prev:stream-read-partial-unsafe ( n buf stream -- count )
Next:stream-read-into ( buf stream -- buf-slice more? )


Vocabulary
io

Inputs
na non-negative integer
streaman input stream


Outputs
seq/fa byte-array, a string, or f


Generic word contract
Reads n elements from the stream. Outputs a truncated string or f on stream exhaustion.

Notes
Most code only works on one stream at a time and should instead use read; see Default input and output streams.

Errors
Throws an error if the I/O operation fails.

Definition