This crate provides an easy to use api to read / write data from / to a bunch of bytes.
```rust use bytebuffer::ByteBuffer;
let mut buffer = ByteBuffer::new(); buffer.writebytes(&vec![0x1, 0xFF, 0x45]); buffer.writeu8(1); buffer.writei8(1); buffer.writeu16(1); buffer.writei16(1); buffer.writeu32(1); buffer.writei32(1); buffer.writeu64(1); buffer.writei64(1); buffer.writef32(0.1); buffer.writef64(0.1); buffer.writestring("Hello"); buffer.writebit(true); buffer.writebits(4, 3); buffer.flush_bits();
let data = buffer.into_bytes();
let mut buffer = ByteBuffer::fromvec(data); let _ = buffer.readbytes(3); let _ = buffer.readu8(); let _ = buffer.readi8(); let _ = buffer.readu16(); let _ = buffer.readi16(); let _ = buffer.readu32(); let _ = buffer.readi32(); let _ = buffer.readu64(); let _ = buffer.readi64(); let _ = buffer.readf32(); let _ = buffer.readf64(); let _ = buffer.readstring(); let _ = buffer.readbit(); let _ = buffer.read_bits(3); ```
Licensed under either of
at your option.
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.