counting-stream


Vocabulary
io.streams.counting

Definition


Methods













M:: counting-stream stream-read-partial-unsafe
( n buf stream -- count )
n buf stream stream>> stream-read-partial-unsafe
:> count stream [ count + ] change-in-count drop count ;



M:: counting-stream stream-read-unsafe
( n buf stream -- count )
n buf stream stream>> stream-read-unsafe :> count stream
[ count + ] change-in-count drop count ;



M:: counting-stream stream-read-until
( seps stream -- seq sep/f )
seps stream stream>> stream-read-until :> ( seq sep ) sep
[ stream [ seq length + ] change-in-count drop ] when
seq sep ;









M:: counting-stream stream-write ( data stream -- )
data stream stream>> stream-write stream
[ data length + ] change-out-count drop ;