/// Truncate the buffer to a given bit length
Truncate the buffer to a given bit length
Truncate the buffer to a given bit length
pub fn truncate(&mut self, bit_len: usize) -> Result<()> {
        if bit_len > self.bit_len() {
            return Err(BitError::NotEnoughData {
                requested: bit_len,
                bits_left: self.bit_len(),
            });
        }
        self.bit_len = bit_len;
        Ok(())
    }
pub fn truncate ( & mut self , bit_len : usize ) -> Result < ( ) > { if bit_len > self . bit_len ( ) { return Err ( BitError :: NotEnoughData { requested : bit_len , bits_left : self . bit_len ( ) , } ) ; } self . bit_len = bit_len ; Ok ( ( ) ) }
Truncate the buffer to a given bit length
Truncate the buffer to a given bit length
&mut self
bit_len
usize