(peek) ( n bs endian> subseq-endian -- bits )


Vocabulary
bitstreams

Inputs
nan object
bsan object
endian>an object
subseq-endianan object


Outputs
bitsan object


Definition


:: (peek) ( n bs endian> subseq-endian -- bits )
n bs enough-bits? [ n bs not-enough-bits ] unless bs
[ byte-pos>> ] [ bit-pos>> n + ] bi #bits>#bytes dupd +
bs bytes>> subseq endian> ( seq -- x ) execute-effect
n bs subseq-endian ( bignum n bs -- bits ) execute-effect ;