Oakrey.BitArray
4.0.0
dotnet add package Oakrey.BitArray --version 4.0.0
NuGet\Install-Package Oakrey.BitArray -Version 4.0.0
<PackageReference Include="Oakrey.BitArray" Version="4.0.0" />
<PackageVersion Include="Oakrey.BitArray" Version="4.0.0" />
<PackageReference Include="Oakrey.BitArray" />
paket add Oakrey.BitArray --version 4.0.0
#r "nuget: Oakrey.BitArray, 4.0.0"
#:package Oakrey.BitArray@4.0.0
#addin nuget:?package=Oakrey.BitArray&version=4.0.0
#tool nuget:?package=Oakrey.BitArray&version=4.0.0
Oakrey.BitArray
Oakrey.BitArray provides compact bit-level storage and numeric read/write helpers for binary protocols, device data, packed flags, and custom encodings.
Features
- Compact
FastBitArraybacked byulong[]words. - Bit access through
Get,Set, indexers,Flip,SetAll, andClear. - Fast helper methods:
CountSetBits,AnySet,AllSet,GetSlice,GetRawArray, andToByteArray. NumericBitArrayhelpers for reading and writing byte, signed integer, unsigned integer, decimal, and double values from arbitrary bit ranges.- Offset and scale support for encoded numeric values.
- Zigzag ushort read/write helpers for specialized 16-bit layouts.
- Dedicated range validation through
BitArrayOutOfRangeException. IEnumerable<bool>support for LINQ and foreach iteration.
Installation
.NET CLI
dotnet add package Oakrey.BitArray
Package Manager Console
Install-Package Oakrey.BitArray
Usage
using Oakrey.BitArray;
FastBitArray bits = new(10);
bits.Set(0, true);
bits.Flip(9);
int enabledBits = bits.CountSetBits();
byte[] packed = bits.ToByteArray();
NumericBitArray numeric = new(32);
numeric.SetUInt32(0, 16, 0xBEEF);
ushort value = numeric.GetUInt16(0, 16);
Numeric Scaling
NumericBitArray payload = new(16);
payload.SetDouble(0, 16, offset: -40, scale: 0.1, value: 21.5);
double temperature = payload.GetDouble(0, 16, offset: -40, scale: 0.1);
SetDouble, GetDouble, and zigzag helpers validate non-finite double values. Set methods that divide by scale reject zero scale.
Requirements
- .NET 10
Project Information
- Author: Oakrey
- Company: Oakrey (oakrey.cz)
- Repository: Common
- Package: Oakrey.BitArray
License
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Oakrey.BitArray:
| Package | Downloads |
|---|---|
|
Oakrey.DBC
Oakrey.DBC is a .NET 10 library for parsing, building, and exporting DBC (CAN database) files. Provides a full object model covering messages, signals (including multiplexing, big/little endian, scale/offset), nodes, attributes, value tables, and relationships. Supports async file parsing via DbcMatrix.CreateAsync and round-trip export via SaveDBC. Designed for automotive, industrial, and IoT applications. |
|
|
Oakrey.Network.Abstractions
Foundational .NET abstractions for network packet parsing and address management. Includes base classes and interfaces for Ethernet, IPv4, and IPv6 packet headers (MacPacketHead, IPv4PacketHead, IPv6PacketHead), transport and network layer abstractions, protocol enums (EtherType, IpProtocol), IP address range types, and raw packet utilities. Integrates with PacketDotNet. |
|
|
Oakrey.DBC.Values
Oakrey.DBC.Values is a .NET 10 library that adds live signal value handling on top of Oakrey.DBC. SignalValue wraps a DBC Signal template with NumericBitArray-backed raw and scaled double access, implements INotifyPropertyChanged for data-binding support, and tracks decimal precision from the signal scale. TaskMessage composes a full CAN message payload from its signal set, supports mux-ID dispatch in SetValues, and maintains a rolling receive history via FixedSizedQueue. Designed for automotive, industrial, and IoT CAN data processing. |
|
|
Oakrey.LDF.Values
Runtime value layer for LIN frames and signals built on top of Oakrey.LDF. Provides LdfSignalValue with INotifyPropertyChanged and physical value decoding via encoding offset and scale, and LdfTaskFrame for composing and parsing raw LIN message bytes across all positioned signals. |
GitHub repositories
This package is not used by any popular GitHub repositories.