Home | Trees | Indices | Help |
---|
|
object --+ | Decoder
Uncompresses a stream of lzw code points, as created by Encoder. Given a list of integer code points, with all unpacking foolishness complete, turns that list of codepoints into a list of uncompressed bytes. See BitUnpacker for what this doesn't do.
Instance Methods | |||
|
|||
|
|||
|
|||
Inherited from |
Properties | |
Inherited from |
Method Details |
Creates a new Decoder. Decoders should not be reused for different streams.
|
Returns the current size of the Decoder's code book, that is, it's mapping of codepoints to byte strings. The return value of this method will change as the decode encounters more encoded input, or control codes. |
Given an iterable of integer codepoints, yields the corresponding bytes, one at a time, as byte strings of length 1. Retains the state of the codebook from call to call, so if you have another stream, you'll likely need another decoder! Decoders will NOT handle END_OF_INFO_CODE (rather, they will handle the code by throwing an exception); END_OF_INFO should be handled by the upstream codepoint generator (see BitUnpacker, for example) >>> import lzw >>> dec = lzw.Decoder() >>> ''.join(dec.decode([103, 97, 98, 98, 97, 32, 258, 260, 262, 121, 111, 263, 259, 261, 256])) 'gabba gabba yo gabba' |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Apr 20 15:25:48 2010 | http://epydoc.sourceforge.net |