with-byte-reader ( byte-array encoding quot -- ) (original) (raw)

with-byte-reader ( byte-array encoding quot -- )
Factor handbook » Input and output » Byte-array streams

Prev: ( encoding -- stream )
Next: with-byte-writer ( encoding quot -- byte-array )

Vocabulary
io.streams.byte-array

Inputs

byte-array a byte-array
encoding an encoding descriptor
quot a quotation

Outputs
None

Word description
Calls the quotation in a new dynamic scope with input-stream rebound to an input stream for reading from a byte array using an encoding.

Definition

USING: io kernel ;

IN: io.streams.byte-array

: with-byte-reader ( byte-array encoding quot -- )
[ ] dip with-input-stream* ; inline