binary library
Utilities for working with binary data and fixed-width integers within Dart.
A spiritual successor to `package:fixnum`
, or "what if fixnum still
received updates and used modern Dart features, with a focus on being able
to manipulate bits and bytes in a way that is both safe and efficient, using
extension types heavily to avoid unnecessary object creation.
Note
Unless otherwise noted, all functionality is based on treating bits as little endian, that is, in a 32-bit integer the leftmost bit is 31 and the rightmost bit is 0. This is the same as the default behavior of the Dart SDK.
Classes
- BitList
-
An variant of
List<bool>
that ensures eachbool
takes one bit of memory. -
IntDescriptor<
T> -
A descriptor for a fixed-width integer type
T
.
Extension Types
Extensions
- BytesBuilderExtension on BytesBuilder
- Additional functionality for BytesBuilder.
- IntExtension on int
- Additional functionality for any integer, without size restrictions.
Constants
- debugCheckUncheckedInRange → const bool
-
Whether
unchecked
methods on fixed-width integers assert when out of range.
Properties
- debugCheckFixedWithInRange ↔ bool
-
Whether some methods on fixed-width integers assert when out of range.
getter/setter pair