stream-read-into ( buf stream -- buf-slice more? )
Factor handbook » Input and output » Streams » Stream protocol

Prev:stream-read ( n stream -- seq/f )
Next:stream-read-partial ( n stream -- seq/f )


Vocabulary
io

Inputs
bufa byte-array, a specialized-array, or a string
streaman input stream


Outputs
buf-slicea slice
more?a boolean


Generic word contract
Reads from the stream into the sequence buf, until either the length of buf is reached or the stream is exhausted. Returns a slice over the part of buf that was written to, and a boolean value that will be f if the stream was exhausted.

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

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

Definition