Introducing BitArray serialization for Newtonsoft.Json and System.Text.Json

We are releasing the M5.BitArraySerialization.Json to NuGet. This library allows serialization of the BitArray class in .NET using JSON. Support for custom JSON converters for both Newtonsoft.Json and System.Text.Json.

Serialization using Newtonsoft.Json

Just add the Newtonsoft.Json.BitArrayConverter to your serializer settings.

Serialization using System.Text.Json

Just add the System.Text.Json.BitArrayConverter to your serializer options.

We even have support for automatic compression of the BitArray using Brotli compression when the size of the array is large enough to take advantage of compression. We leverage this capability in our M5.BloomFilter implementation to decrease the size of our bloom filter when transferring it across the network. More on this topic in a future article.

Enjoy using M5.BitArraySerialization.Json for your own needs.

Author(s):
Richard Crane, Founder/CTO

Disclaimer:

M5.BitArraySerialization.Json is licensed under the Apache 2.0 license.

References:

BitArray Class (System.Collections) | Microsoft Docs

 

M5.BitArraySerialization.Json – NuGet

https://www.nuget.org/packages/M5.BitArraySerialization.Json/

M5.BitArraySerialization.Json – GitHub

https://github.com/MILL5/M5.BloomFilter/tree/main/M5.BitArraySerialization.Json

*** The article came from Richard Crane, Founder/CTO, MILL5 (wickedprogrammer.com).