//! Bitstream reader functionality.
//!
-//! Bitstream reader operates on `&[u8]` and allows to read bits from the slice in different modes.
+//! Bitstream reader operates on `&[u8]` and allows to read bits from the slice in different modes.
//!
//! # Examples
//!
//! use nihav_core::io::bitreader::{BitReader,BitReaderMode};
//!
//! # use nihav_core::io::bitreader::BitReaderResult;
-//! # fn foo() -> BitReaderResult<u32> {
+//! # fn foo() -> BitReaderResult<u32> {
//! let bits: [u8; 4] = [ 42, 43, 44, 45 ];
//! let mut br = BitReader::new(&bits, BitReaderMode::BE);
//! let value = br.read(17)?;
//! use nihav_core::io::bitreader::{BitReader,BitReaderMode};
//!
//! # use nihav_core::io::bitreader::BitReaderResult;
-//! # fn foo() -> BitReaderResult<()> {
+//! # fn foo() -> BitReaderResult<()> {
//! let bits: [u8; 4] = [ 42, 43, 44, 45 ];
//! let mut br = BitReader::new(&bits, BitReaderMode::BE);
//! let num_skip_bits = br.read(3)?;
impl<'a> BitReader<'a> {
/// Constructs a new instance of bitstream reader.
- ///
+ ///
/// # Examples
///
/// ```
/// use nihav_core::io::bitreader::{BitReader,BitReaderMode};
///
/// # use nihav_core::io::bitreader::BitReaderResult;
- /// # fn foo() -> BitReaderResult<u32> {
+ /// # fn foo() -> BitReaderResult<u32> {
/// let bits: [u8; 4] = [ 42, 43, 44, 45 ];
/// let mut br = BitReader::new(&bits, BitReaderMode::BE);
/// let value = br.read(17)?;
/// use nihav_core::io::bitreader::{BitReader,BitReaderMode};
///
/// # use nihav_core::io::bitreader::BitReaderResult;
- /// # fn foo() -> BitReaderResult<u32> {
+ /// # fn foo() -> BitReaderResult<u32> {
/// let bits: [u8; 4] = [ 42, 43, 44, 45 ];
/// let mut br = BitReader::new(&bits, BitReaderMode::BE);
/// let peek_value = br.peek(8); // this should return 42
/// use nihav_core::io::bitreader::{BitReader,BitReaderMode};
///
/// # use nihav_core::io::bitreader::BitReaderResult;
- /// # fn foo() -> BitReaderResult<u32> {
+ /// # fn foo() -> BitReaderResult<u32> {
/// let bits: [u8; 4] = [ 42, 43, 44, 45 ];
/// let mut br = BitReader::new(&bits, BitReaderMode::BE);
/// br.seek(16)?;
/// use nihav_core::io::bitreader::{BitReader,BitReaderMode};
///
/// # use nihav_core::io::bitreader::BitReaderResult;
- /// # fn foo() -> BitReaderResult<()> {
+ /// # fn foo() -> BitReaderResult<()> {
/// let bits: [u8; 4] = [ 42, 43, 44, 45 ];
/// let mut br = BitReader::new(&bits, BitReaderMode::BE);
/// br.skip(17)?; // now reader is at bit position 17