Trait vorbis::BitRead [] [src]

pub trait BitRead: Read {
    fn try_read_u32_bits(&mut self, len_bits: usize) -> Result<(u32, usize)>;
    fn unread_u32_bits(&mut self, bits: u32, len_bits: usize);

    fn read_u32_bits(&mut self, len_bits: usize) -> Result<u32> { ... }
    fn read_u8_bits(&mut self, len_bits: usize) -> Result<u8> { ... }
    fn read_u8(&mut self) -> Result<u8> { ... }
    fn read_u16_bits(&mut self, len_bits: usize) -> Result<u16> { ... }
    fn read_u16(&mut self) -> Result<u16> { ... }
    fn read_i32_bits(&mut self, len_bits: usize) -> Result<i32> { ... }
    fn read_u32(&mut self) -> Result<u32> { ... }
    fn read_i32(&mut self) -> Result<i32> { ... }
    fn read_bool(&mut self) -> Result<bool> { ... }
    fn read_f32(&mut self) -> Result<f32> { ... }
}

A Read-like trait that works on a bit level as specified by Bitpacking Convention.

Required Methods

Atempts reading at most len_bits and returns the bits read as u32 value and the number of bits read as usize.

Pushes back the bits into internal buffer. The buffered bits will be read again by successive try_read_u32_bits() calls.

Panics

Panics if the len_bits and the existing buffered bits form a value wider than 64 bits. Effectively this means it's not possible to unread more than 32 bits.

Provided Methods

Reads exactly len_bits and returns the bits read as u32 value or ErrorKind::UnexpectedEof if it wasn't possible to read enough bits.

Reads f32 value as defined by float32_unpack.

Implementors