pub trait BitRead<'a>: BitReadInternal + Copy {
    fn new(_: &'a [u8]) -> Self;
    fn consumed(&self) -> usize;
    fn available(&self) -> usize;
    fn skip_bits(&mut self, size: usize);

    fn get_bit(&mut self) -> bool { ... }
    fn get_bits_64(&mut self, n: usize) -> u64 { ... }
    fn get_bits_32(&mut self, n: usize) -> u32 { ... }
    fn peek_bit(&mut self) -> bool { ... }
    fn peek_bits_32(&mut self, n: usize) -> u32 { ... }
    fn peek_bits_64(&self, n: usize) -> u64 { ... }
    fn align_bits(&mut self) { ... }
}
Expand description

Used to define a bitreader.

Required Methods

Creates a new bitreader with an internal buffer associated to it.

Tells the number of bits read from the internal buffer.

Tells the number of bits still available in the internal buffer.

Discard a certain number of bits from the internal buffer.

Provided Methods

Returns a single bit from the internal buffer.

Returns n bits from the internal buffer as a 64-bit sequence.

Returns n bits from the internal buffer as a 32-bit sequence.

Peeks the next bit present in the internal buffer.

Peeks the next 32-bit sequence present in the internal buffer.

Peeks the next 64-bit sequence present in the internal buffer.

Aligns the bits present in the internal buffer.

Implementors