Struct bitstream_io::read::BitReaderBE
[−]
[src]
pub struct BitReaderBE<'a> { /* fields omitted */ }
A wrapper for reading values from a big-endian stream.
Methods
impl<'a> BitReaderBE<'a>
[src]
fn new(reader: &mut Read) -> BitReaderBE
Wraps a big-endian reader around a Read
reference.
Trait Implementations
impl<'a> BitRead for BitReaderBE<'a>
[src]
fn read<U>(&mut self, bits: u32) -> Result<U, Error> where U: Numeric
Reads an unsigned value from the stream with the given number of bits. This method assumes that the programmer is using an output type sufficiently large to hold those bits. Read more
fn skip(&mut self, bits: u32) -> Result<(), Error>
Skips the given number of bits in the stream. Since this method does not need an accumulator, it may be slightly faster than reading to an empty variable. In addition, since there is no accumulator, there is no upper limit on the number of bits which may be skipped. These bits are still read from the stream, however, and are never skipped via a seek
method. Read more
fn read_signed<S>(&mut self, bits: u32) -> Result<S, Error> where S: SignedNumeric
Reads a twos-complement signed value from the stream with the given number of bits. This method assumes that the programmer is using an output type sufficiently large to hold those bits. Read more
fn read_bytes(&mut self, buf: &mut [u8]) -> Result<(), Error>
Completely fills the given buffer with whole bytes. If the stream is already byte-aligned, it will map to a faster read_exact
call. Otherwise it will read bytes individually in 8-bit increments. Read more
fn read_unary0(&mut self) -> Result<u32, Error>
Counts the number of 1 bits in the stream until the next 0 bit and returns the amount read. Because this field is variably-sized and may be large, its output is always a u32
type. Read more
fn read_unary1(&mut self) -> Result<u32, Error>
Counts the number of 0 bits in the stream until the next 1 bit and returns the amount read. Because this field is variably-sized and may be large, its output is always a u32
type. Read more
fn byte_aligned(&self) -> bool
Returns true if the stream is aligned at a whole byte.
fn byte_align(&mut self)
Throws away all unread bit values until the next whole byte.