1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors bitstreams io io.streams.string kernel tools.test
4 grouping compression.lzw multiline ;
8 [ B{ 254 } <string-reader> <bitstream-reader> read-bit ] unit-test
11 [ B{ 254 } <string-reader> <bitstream-reader> 8 swap read-bits ] unit-test
14 [ B{ 255 255 } <string-reader> <bitstream-reader> 12 swap read-bits ] unit-test
18 <string-writer> <bitstream-writer> 254 8 rot
19 [ write-bits ] keep stream>> >byte-array
27 B{ 7 7 7 8 8 7 7 9 7 }
28 [ byte-array>bignum >bin 72 CHAR: 0 pad-head 9 group [ bin> ] map ]