pub fn write_bits(&mut self, value: u64, n: u8) {
        if n > 0 {
            self.write_bit((value >> n - 1) & 1 != 0);
            self.write_bits(value, n - 1);
        } else {
            self.write_bit((value & 1) != 0);
        }
    }
/// Write the given value as a sequence of n bits
///
/// #Example
///
/// ```
/// #  use databuffer::*;
/// let mut buffer = DataBuffer::new();
/// buffer.write_bits(4, 3); // append 100b
/// ```
Write the given value as a sequence of n bits
Write the given value as a sequence of n bits
pub fn write_bits(&mut self, value: u64, n: u8) {
        if n > 0 {
            self.write_bit((value >> n - 1) & 1 != 0);
            self.write_bits(value, n - 1);
        } else {
            self.write_bit((value & 1) != 0);
        }
    }
pub fn write_bits ( & mut self , value : u64 , n : u8 ) { if n > 0 { self . write_bit ( ( value >> n - 1 ) & 1 != 0 ) ; self . write_bits ( value , n - 1 ) ; } else { self . write_bit ( ( value & 1 ) != 0 ) ; } }
Write the given value as a sequence of n bits
Write the given value as a sequence of n bits
&mut self
value
u64
n
u8
example
None
use databuffer::*;
let mut buffer = DataBuffer::new();
buffer.write_bits(4, 3); // append 100b
```
let mut buffer = DataBuffer :: new () ; buffer . write_bits ( 4 3 ) ; // append 100b ` ` `