Handbook
Glossary
lsb0-bit-writer
Vocabulary
bitstreams
Definition
IN:
bitstreams
TUPLE:
lsb0-bit-writer
<
bit-writer
;
Methods
USING:
accessors
bitstreams
bitstreams.private
kernel
math
sequences
;
M::
lsb0-bit-writer
poke
( value n bs -- )
value n
<widthed>
:>
widthed widthed bs
widthed>>
#bits>>
8
swap
-
split-widthed
:>
( byte remainder ) byte bs
widthed>>
|widthed
:>
new-byte new-byte
#bits>>
8
=
[
new-byte
bits>>
bs
bytes>>
push
zero-widthed
bs
widthed<<
remainder
widthed>bytes
[
bs
bytes>>
push-all
]
[
bs
widthed<<
]
bi*
]
[
byte bs
widthed<<
]
if
;