bitbit provides functions to read and write streams one bit at a time.
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));
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));