Struct bitstream_io::write::BitWriterBE
[−]
[src]
pub struct BitWriterBE<'a> { /* fields omitted */ }
A wrapper for writing values to a big-endian stream.
Methods
impl<'a> BitWriterBE<'a>
[src]
fn new(writer: &mut Write) -> BitWriterBE
Wraps a big-endian writer around a Write
reference.
Because this is liable to make many small writes
in the course of normal operation, a BufWrite
is preferable
for better performance.
Trait Implementations
impl<'a> BitWrite for BitWriterBE<'a>
[src]
fn write<U>(&mut self, bits: u32, value: U) -> Result<(), Error> where U: Numeric
Writes an unsigned value to the stream using the given number of bits. This method assumes that value's type is sufficiently large to hold those bits. Read more
fn write_signed<S>(&mut self, bits: u32, value: S) -> Result<(), Error> where S: SignedNumeric
Writes a twos-complement signed value to the stream with the given number of bits. This method assumes that value's type is sufficiently large to hold those bits. Read more
fn write_bytes(&mut self, buf: &[u8]) -> Result<(), Error>
Writes the entirety of a byte buffer to the stream. If the stream is already byte-aligned, it will often map to a faster write_all
call. Otherwise it will write bytes individually in 8-bit increments. Read more
fn byte_aligned(&self) -> bool
Returns true if the stream is aligned at a whole byte.
fn write_unary0(&mut self, value: u32) -> Result<(), Error>
Writes value
number of 1 bits to the stream and then writes a 0 bit. This field is variably-sized. Read more
fn write_unary1(&mut self, value: u32) -> Result<(), Error>
Writes value
number of 0 bits to the stream and then writes a 1 bit. This field is variably-sized. Read more
fn byte_align(&mut self) -> Result<(), Error>
Pads the stream with 0 bits until is aligned at a whole byte. Does nothing if the stream is already aligned. Read more