1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00
Reading and writing data types of arbitrary bit length that might not be byte-aligned
  • Rust 99.8%
  • Nix 0.2%
Find a file
2019-02-28 20:34:59 +01:00
bitstream_reader_derive allow deriving BitReadSized for enums 2019-02-28 20:24:43 +01:00
src expand crate level example 2019-02-28 20:33:01 +01:00
tests impl ReadSized for BitStream 2019-02-28 17:04:49 +01:00
.gitignore basics 2019-02-12 21:22:24 +01:00
.travis.yml add travis config 2019-02-28 20:34:59 +01:00
bitbuffer.iml add derive macro for Read 2019-02-27 23:53:17 +01:00
Cargo.toml add derive macro for Read 2019-02-27 23:53:17 +01:00
LICENSE-APACHE switch licence to apache/mit 2019-02-22 22:47:56 +01:00
LICENSE-MIT switch licence to apache/mit 2019-02-22 22:47:56 +01:00
README.md add licence part to readme 2019-02-27 18:46:37 +01:00

bitstream_reader

Reading bit sequences from a byte slice in rust

Example

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.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.