X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fio%2Fbitreader.rs;h=569330b5be59e14ab75612c14462ba18832dec0a;hb=12259bf7f62e75d8711734b706a23da8a9b4f262;hp=6c786228c1ecf9465e387f27ab6516e7c406891d;hpb=155c91e4c10925336ede2c40d87f54b9234b590a;p=nihav.git diff --git a/nihav-core/src/io/bitreader.rs b/nihav-core/src/io/bitreader.rs index 6c78622..569330b 100644 --- a/nihav-core/src/io/bitreader.rs +++ b/nihav-core/src/io/bitreader.rs @@ -90,6 +90,9 @@ impl<'a> BitReader<'a> { BitReader{ cache: 0, pos: 0, bits: 0, src, mode } } + /// Returns the data bitstream reader uses. + pub fn get_data(&self) -> &'a [u8] { self.src } + /// Reports the current bit position in the bitstream (usually simply the number of bits read so far). pub fn tell(&self) -> usize { self.pos * 8 - (self.bits as usize)