Home
Extension methods on primitive types for various binary operations, such as reading and writing values from bytes and calculating parity.
The name is based on the BinaryPrimitives class in the .NET Framework which provides similar methods.
Reading and Writing
Extension methods on byte container types (byte[], Span<byte>, Stream, and others) for reading and writing multi-byte primitive values with configurable endianness.
UInt24
A 24-bit unsigned integer value type (UInt24) bridging the gap between ushort (16-bit) and uint (32-bit). Implements the full suite of .NET generic math interfaces and is returned by all GetUInt24 read methods.
Bit Operations
Extension methods on integer types (byte, ushort, int, uint, long, ulong) for common bit-level operations: individual bit access, bit range extraction and replacement, nibble manipulation, parity, overflow detection, and binary string formatting.
Streams
Two Stream implementations for byte-oriented work: ReadOnlyListStream wraps an IReadOnlyList<byte> as a seekable read-only stream, and PeekableStream adds peek-without-consuming to any readable stream.
Use of AI
My general rule is I'll write the interesting bits and use AI for the boring bits. I wrote the bulk of the code as part of my OakEmu project before forking it out into its own project. The main use of AI has been to generate the documentation and help with test coverage.
Licencing
Licensed under GPL v3.0.