bitbit 0.1.2

Bit-at-a-time reader/writer types

Crate bitbit [] [src]

bitbit provides functions to read and write streams one bit at a time.

Reading

let r = try!(File::open("somefile"));
let mut br = BitReader::new(r);

let is_one = try!(br.read_bit());

let byte = try!(br.read_byte());

let num = try!(br.read_bits(5));

Writing

let w = try!(File::create("somefile"));
let mut bw = BitWriter::new(w);

try!(br.write_bit(true));

try!(br.write_byte(0x55));

try!(br.write_bits(0x15, 5));

Reexports

pub use reader::{BitReader, MSB, LSB};
pub use writer::BitWriter;

Modules

reader
writer