mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-04 00:54:07 +02:00
rename to bitstream_reader
This commit is contained in:
parent
ed19848d2a
commit
159ee1df6c
3 changed files with 24 additions and 6 deletions
18
README.md
Normal file
18
README.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# bitstream_reader
|
||||
|
||||
Reading bit sequences from a byte slice in rust
|
||||
|
||||
## Example
|
||||
|
||||
```rust
|
||||
use bitstream_reader::{BitBuffer, LittleEndian};
|
||||
|
||||
let bytes: &[u8] = &[
|
||||
0b1011_0101, 0b0110_1010, 0b1010_1100, 0b1001_1001,
|
||||
0b1001_1001, 0b1001_1001, 0b1001_1001, 0b1110_0111
|
||||
];
|
||||
let buffer: BitBuffer<LittleEndian> = BitBuffer::new(bytes);
|
||||
let result = buffer.read::<u16>(10, 9).unwrap();
|
||||
```
|
||||
|
||||
You can read up to a maximum of 64 bit.
|
||||
Loading…
Add table
Add a link
Reference in a new issue