>limited-seek ( stream -- stream' )


Vocabulary
io.streams.limited.private

Definition
USING: accessors io kernel math ;

IN: io.streams.limited.private

: >limited-seek ( stream -- stream' )
dup start>> [
dup stream-tell >>current dup
[ current>> ] [ count>> ] bi - >>start dup
[ start>> ] [ limit>> ] bi + >>stop
] unless ;