Options
All
  • Public
  • Public/Protected
  • All
Menu

Represent a sequence of bits within a BitStructure.

All bit field values are represented as unsigned integers.

NOTE User code should not invoke this constructor directly. Use the container {@link BitStructure#addField|addField} helper method.

NOTE BitField instances are not instances of Layout since {@link Layout#span|span} measures 8-bit units.

param container

initializer for {@link BitField#container|container}.

param bits

initializer for {@link BitField#bits|bits}.

param [property]

initializer for {@link Layout#property|property}.

Hierarchy

Index

Constructors

constructor

Properties

bits

bits: number

container

container: BitStructure

property

property: string

start

start: number

valueMask

valueMask: number

wordMask

wordMask: number

Methods

decode

  • decode(b?: Uint8Array, offset?: number): unknown
  • Store a value into the corresponding subsequence of the containing bit field.

    Parameters

    • Optional b: Uint8Array
    • Optional offset: number

    Returns unknown

encode

  • encode(value: unknown): void
  • Store a value into the corresponding subsequence of the containing bit field.

    NOTE This is not a specialization of {@link Layout#encode|Layout.encode} and there is no return value.

    Parameters

    • value: unknown

    Returns void

Generated using TypeDoc