limit-stream ( stream limit -- stream' )


Vocabulary
io.streams.limited

Inputs
streaman input stream
limitan integer


Outputs
stream'a stream


Word description
Changes a decoder's stream to be a limited stream, or wraps stream in a limited-stream.

Examples
Limiting a longer stream to length three:
USING: accessors continuations io io.streams.limited io.streams.string kernel prettyprint ; "123456" <string-reader> 3 limit-stream 100 swap stream-read .
"123"


Definition

GENERIC#: limit-stream 1 ( stream limit -- stream' )


Methods