pub fn convert_bits( data: &[u8], inbits: u8, outbits: u8, pad: bool ) -> Result<Vec<u8>, DecodingError>