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.

Richard Crane, Founder/CTO


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


BitArray Class (System.Collections) | Microsoft Docs


M5.BitArraySerialization.Json – NuGet

M5.BitArraySerialization.Json – GitHub

*** The article came from Richard Crane, Founder/CTO, MILL5 (