Options
All
  • Public
  • Public/Protected
  • All
Menu

A class implementing a byte (octet).

Hierarchy

  • Byte

Index

Methods

clearBit

  • clearBit(offset: number): void
  • Clears the bit at the given offset (i.e. sets it to 0).

    Parameters

    • offset: number

      Bit to clear (i.e. to set to 0).

    Returns void

getBit

  • getBit(offset: number): number
  • Get the bit at the supplied offset using LSB ordering.

    Parameters

    • offset: number

      The position (integer from 0 to 7).

    Returns number

readUIntLSB

  • readUIntLSB(begin?: number, size?: number): number
  • Compute unsigned integer value with least significant bit first.

    Parameters

    • begin: number = 0

      Bit offset to be interpreted as LSB.

    • size: number = ...

      Size in bits; default is all remaining bits (8 - begin); must be >= 0 and satisfy (begin + size) <= 8.

    Returns number

readUIntMSB

  • readUIntMSB(begin?: number, size?: number): number
  • Compute unsigned integer value with most significant bit first.

    Parameters

    • begin: number = 0

      Bit offset to be interpreted as MSB.

    • size: number = ...

    Returns number

setBit

  • setBit(offset: number, value?: number): void
  • Set the bit at the supplied offset using LSB ordering.

    Parameters

    • offset: number

      The position (integer from 0 to 7).

    • value: number = 1

      Either 0 or 1, default value is 1.

    Returns void

toStringLSB

  • toStringLSB(): string
  • Convert to 8 character string of 0s and 1s (least significant bit first).

    Returns string

toStringMSB

  • toStringMSB(): string
  • Convert to 8 character string of 0s and 1s (most significant bit first).

    Returns string

writeUIntLSB

  • writeUIntLSB(value: number, begin?: number, size?: number): void
  • Set unsigned integer value with least significant bit first.

    Parameters

    • value: number
    • begin: number = 0

      Bit offset to be interpreted as LSB.

    • size: number = ...

      Bit offset to be interpreted as MSB.

    Returns void

Static allOne

  • Creates a new Byte with all bits set to 1.

    Returns Byte

Static allZero

  • Creates a new Byte with all bits set to 0.

    Returns Byte

Static fromUInt8LSB

  • fromUInt8LSB(val?: number): Byte
  • Creates a new Byte with bits set according to the supplied argument interpreted as unsigned integer with LSB.

    Parameters

    • val: number = 0

    Returns Byte

Generated using TypeDoc