pub(crate) fn read_up_to_byte_from_offset(
slice: &[u8],
number_of_bits_to_read: usize,
bit_offset: usize,
) -> u8Expand description
Read up to 8 bits from a byte slice starting at a given bit offset.
§Arguments
slice- The byte slice to read fromnumber_of_bits_to_read- Number of bits to read (must be < 8)bit_offset- Starting bit offset within the first byte (must be < 8)
§Returns
A u8 containing the requested bits in the least significant positions
§Panics
- Panics if
number_of_bits_to_readis 0 or >= 8 - Panics if
bit_offsetis >= 8 - Panics if
sliceis empty or too small to read the requested bits