fleabit

fleabit is a Rust crate that allows reading and writing unaligned bytes. It provides a simple API and is built on top of bitvec.

It is intended for a multiplayer game library that's in development.

Note that this crate is probably not production ready. Use at your own discretion.

Example

```rust use fleabit::{FleaBitReader, FleaBitWriter};

let mut writer = FleaBitWriter::new();

writer.bool(false); asserteq!(writer.tostring(), ".......0");

writer.u8(135); asserteq!(writer.tostring(), "00001110_.......1");

let bytes = writer.intovec(); asserteq!(bytes, vec![0x0e, 0x01]);

let mut reader = FleaBitReader::fromslice(&bytes); asserteq!(reader.bool(), false); assert_eq!(reader.u8(), 135); ```

License

fleabit is licensed under either the MIT license or the Apache-2.0 license, at your discretion.