ExplicitEnumBinaryCodec class
Binary codec for ExplicitEnum type (uses variant name strings).
Encodes enum variants as UTF-8 strings of variant names. Nested encoding uses 4-byte length prefix, top-level has no prefix.
- Mixed-in types
Constructors
- ExplicitEnumBinaryCodec()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decodeNested(
Uint8List buffer, ExplicitEnumType type, int offset) → (ExplicitEnumValue, int) - Decodes ExplicitEnum from nested position, returns (value, bytesConsumed).
-
decodeTopLevel(
Uint8List buffer, ExplicitEnumType type) → ExplicitEnumValue - Decodes ExplicitEnum from top-level buffer (no length prefix).
-
encodeNested(
ExplicitEnumValue value) → Uint8List - Encodes ExplicitEnum for nested (4-byte length + UTF-8 string).
-
encodeTopLevel(
ExplicitEnumValue value) → Uint8List - Encodes ExplicitEnum for top-level (no length prefix).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requireBufferLength(
Uint8List buffer, int offset, int requiredBytes, [String? typeName]) → void -
Validates buffer has at least
requiredBytesstarting fromoffset.inherited -
requireBytesRead(
Uint8List buffer, int offset, int bytesRead) → void -
Validates bytes read don't exceed buffer bounds.
inherited
-
requireEndOffset(
Uint8List buffer, int offset, int length, [String? typeName]) → void -
Validates calculated end offset doesn't exceed buffer length.
inherited
-
requireExactLength(
Uint8List buffer, int requiredBytes, [String? typeName]) → void -
Validates buffer has exactly
requiredByteslength.inherited -
requireMaxLength(
Uint8List buffer, int maxLength) → void -
Validates buffer doesn't exceed maximum allowed length.
inherited
-
requireMinimumLength(
Uint8List buffer, int minLength, [String? typeName]) → void -
Validates buffer meets minimum length requirement.
inherited
-
requireOffsetInBounds(
Uint8List buffer, int offset, [String? context]) → void -
Validates offset is not at or beyond buffer end.
inherited
-
requireOffsetWithBytes(
Uint8List buffer, int offset, int requiredBytes) → void -
Validates offset with specific minimum required bytes.
inherited
-
requireValidOffset(
Uint8List buffer, int offset) → void -
Validates offset is within valid range for buffer.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited