A .NET declarative serialization framework for precise byte and bit-level control over binary formats and protocols.
BinarySerializer is a .NET declarative serialization framework designed for precise control over binary data formatting at the byte and bit level. It solves the problem of working with complex binary formats and network protocols by allowing developers to define serialization logic through attributes and bindings, making it fast and simple to parse or generate structured binary data.
.NET developers working with binary file formats, network protocols, embedded systems communication, or any scenario requiring exact control over binary data layout.
Developers choose BinarySerializer for its declarative approach, extensive attribute set for fine-grained control, and performance optimizations like reflection caching. It eliminates manual byte manipulation, reduces boilerplate code, and supports complex scenarios like conditional fields, checksums, and dynamic subtypes.
A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers over 25 attributes like FieldLength and FieldChecksum for precise byte and bit-level manipulation, enabling complex formats such as bound lengths and CRCs without manual byte wrangling.
Supports dynamic bindings across the object graph, including ancestors and child nodes, as shown with RelativeSourceMode, allowing fields to depend on others without boilerplate code.
Uses reflection caching and phased operations to speed up serialization, though this increases memory footprint, as noted in the Performance section for frequent type usage.
Allows custom serialization via IBinarySerializable and extensible attributes like FieldValueAttributeBase, demonstrated with examples such as Varuint and FieldSha256 for cryptographic hashes.
Mandates FieldOrder attributes on all multi-field classes and careful binding setup, which can lead to errors and a steeper learning curve compared to more automatic serializers.
Has a smaller community and fewer integrations than mainstream options like Newtonsoft.Json, relying on niche use cases and fewer third-party tools or examples.
Caches reflection data statically, increasing memory usage, and deferred type resolution can cause performance hits in dynamic scenarios, as admitted in the Performance section.
README warns of undefined results with bit fields in big endian mode and limitations with non-seekable streams, indicating potential reliability issues in specific scenarios.