pub struct BitPacker {
pub output: Vec<u8>,
pub padding: u8,
/* private fields */
}Expand description
Creates a huffman-encoded, packed bitstream of one block of data. The final byte of the block is padded with zeros to reach a full byte. The padding is always a number between 0 and 7 inclusive.
Fields§
§output: Vec<u8>The output buffer which can be read externally.
padding: u8The number of zero bits padded to the last byte of the output buffer.
Implementations§
Source§impl BitPacker
Creates a huffman-encoded, packed bitstream of one block of data. The final byte of the block
is padded with zeros to reach a full byte. The padding is always a number between 0 and 7
inclusive.
impl BitPacker
Creates a huffman-encoded, packed bitstream of one block of data. The final byte of the block is padded with zeros to reach a full byte. The padding is always a number between 0 and 7 inclusive.
Sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Create a new BitPacker with an output buffer with the capacity specified in size.
Sourcepub fn out24(&mut self, data: u32)
pub fn out24(&mut self, data: u32)
Writes 0-24 bits encoded with the number of bits to write in the most significant byte of a 32 bit word.
Sourcepub fn out32(&mut self, data: u32)
pub fn out32(&mut self, data: u32)
Puts a 32 bit word of pre-packed binary encoded data on the stream.
Sourcepub fn out16(&mut self, data: u16)
pub fn out16(&mut self, data: u16)
Puts a 16 bit word of pre-packed binary encoded data on the stream.