Add method to bitfield to read specific byte
This commit is contained in:
parent
27743f3466
commit
029a69a4a5
@ -117,6 +117,11 @@ impl BooleanBitfield {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the byte at a position, assuming big-endian encoding.
|
||||||
|
pub fn get_byte(&self, n: usize) -> Option<&u8> {
|
||||||
|
self.vec.get(n)
|
||||||
|
}
|
||||||
|
|
||||||
/// Clone and return the underlying byte array (`Vec<u8>`).
|
/// Clone and return the underlying byte array (`Vec<u8>`).
|
||||||
pub fn to_be_vec(&self) -> Vec<u8> {
|
pub fn to_be_vec(&self) -> Vec<u8> {
|
||||||
let mut o = self.vec.clone();
|
let mut o = self.vec.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user