Lines Matching refs:bit_writer

137         let mut bit_writer = BitsWriter::new(bytes_writer);  in test_write_bit()  localVariable
139 bit_writer.write_bit(0).unwrap(); in test_write_bit()
140 bit_writer.write_bit(0).unwrap(); in test_write_bit()
141 bit_writer.write_bit(0).unwrap(); in test_write_bit()
142 bit_writer.write_bit(0).unwrap(); in test_write_bit()
144 bit_writer.write_bit(0).unwrap(); in test_write_bit()
145 bit_writer.write_bit(0).unwrap(); in test_write_bit()
146 bit_writer.write_bit(1).unwrap(); in test_write_bit()
147 bit_writer.write_bit(0).unwrap(); in test_write_bit()
149 let byte = bit_writer.get_current_bytes(); in test_write_bit()
152 bit_writer.write_bit(1).unwrap(); in test_write_bit()
153 bit_writer.write_bit(1).unwrap(); in test_write_bit()
155 println!("=={}=={}==", bit_writer.cur_bit_num, bit_writer.cur_byte); in test_write_bit()
156 assert!(bit_writer.cur_bit_num == 2); in test_write_bit()
157 assert!(bit_writer.cur_byte == 0xC0); //0x11000000 in test_write_bit()
163 let mut bit_writer = BitsWriter::new(bytes_writer); in test_write_n_bits() localVariable
165 bit_writer.write_bit(1).unwrap(); in test_write_n_bits()
166 bit_writer.write_bit(1).unwrap(); in test_write_n_bits()
167 bit_writer.write_bit(0).unwrap(); in test_write_n_bits()
169 bit_writer.write_n_bits(0x03, 7).unwrap(); in test_write_n_bits()
171 let byte = bit_writer.get_current_bytes(); in test_write_n_bits()
175 println!("=={}=={}==", bit_writer.cur_bit_num, bit_writer.cur_byte); in test_write_n_bits()
180 assert!(bit_writer.cur_bit_num == 2); in test_write_n_bits()
181 assert!(bit_writer.cur_byte == 0xC0); //0x11000000 in test_write_n_bits()
187 let mut bit_writer = BitsWriter::new(bytes_writer); in test_bits_aligment_8() localVariable
189 bit_writer.write_bit(1).unwrap(); in test_bits_aligment_8()
190 bit_writer.write_bit(1).unwrap(); in test_bits_aligment_8()
191 bit_writer.write_bit(0).unwrap(); in test_bits_aligment_8()
193 bit_writer.bits_aligment_8().unwrap(); in test_bits_aligment_8()
195 let byte = bit_writer.get_current_bytes(); in test_bits_aligment_8()
198 bit_writer.write_bit(1).unwrap(); in test_bits_aligment_8()
199 bit_writer.write_bit(1).unwrap(); in test_bits_aligment_8()
200 bit_writer.write_bit(0).unwrap(); in test_bits_aligment_8()
202 assert!(bit_writer.cur_bit_num == 3); in test_bits_aligment_8()
203 assert!(bit_writer.cur_byte == 0xC0); //0x11000000 in test_bits_aligment_8()