read-partial-into ( buf -- buf-slice more? ) (original) (raw)

Vocabulary
io

Inputs

buf a byte-array, a specialized-array, or a string

Outputs

buf-slice a slice
more? a boolean

Generic word contract
Reads available data from the current input-stream into the sequence buf without blocking until all immediately available data is read or the length of buf is reached. If no data is immediately available, blocks until data is available. Returns a slice over the part of buf that was written to, and a boolean that will be f if the stream was exhausted.

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

Definition

USING: namespaces ;

IN: io

: read-partial-into ( buf -- buf-slice more? )
input-stream get stream-read-partial-into ; inline