Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataBufferStream

A data buffer stream.

Hierarchy

  • DataBufferStream

Index

Constructors

constructor

  • Initializes a new instance of the fm.icelink.dataBufferStream class.

    Parameters

    • dataBufferSize: number

      Size of the data buffer.

    Returns DataBufferStream

  • Initializes a new instance of the fm.icelink.dataBufferStream class.

    Parameters

    • dataBufferSize: number

      Size of the data buffer.

    • littleEndian: boolean

      Whether the data is little-endian.

    Returns DataBufferStream

  • Initializes a new instance of the fm.icelink.dataBufferStream class.

    Parameters

    • buffer: DataBuffer

      The buffer.

    Returns DataBufferStream

Properties

Private __bitPosition

__bitPosition: number
internal

Private __buffer

__buffer: DataBuffer
internal

Private __position

__position: number
internal

Methods

getAvailable

  • getAvailable(): number
  • Gets the available bytes to be read from the DataBuffer.

    Returns number

getBitPosition

  • getBitPosition(): number
  • Gets the bit position within a byte.

    Returns number

getBuffer

  • getBuffer(): DataBuffer
  • Gets the buffer.

    Returns DataBuffer

getLength

  • getLength(): number
  • Gets the buffer length.

    Returns number

getPosition

  • getPosition(): number
  • Gets the position within the stream.

    Returns number

getTypeString

  • getTypeString(): string
  • Returns string

nextByte

  • nextByte(): void
  • Resets the bit count to 0 and advances to the next byte.

    Returns void

peek

  • peek(): number
  • Reads an 8-bit value from the DataBuffer without advancing the Position.

    Returns number

read

  • read(length: number): DataBuffer
  • Reads the specified length from the DataBuffer and advances the position by the length.

    Parameters

    • length: number

      The length.

    Returns DataBuffer

read1

  • read1(): boolean
  • Read a single bit and advance the bit position by 1.

    Returns boolean

read15

  • read15(): number
  • Reads an 15-bit value from the DataBuffer and advances the Position by 1 and the BitPosition by 7.

    Returns number

read16

  • read16(): number
  • Reads an 16-bit value from the DataBuffer and advances the Position by 2.

    Returns number

read2

  • read2(): number
  • Read a 2-bit value and advance the BitPosition by 2.

    Returns number

read24

  • read24(): number
  • Reads an 24-bit value from the DataBuffer and advances the Position by 3.

    Returns number

read3

  • read3(): number
  • Read a 3-bit value and advance the BitPosition by 3.

    Returns number

read32

  • read32(): number
  • Reads an 32-bit value from the DataBuffer and advances the Position by 4.

    Returns number

read4

  • read4(): number
  • Read a 4-bit value and advance the BitPosition by 4.

    Returns number

read40

  • read40(): number
  • Reads an 40-bit value from the DataBuffer and advances the Position by 5.

    Returns number

read48

  • read48(): number
  • Reads an 48-bit value from the DataBuffer and advances the Position by 6.

    Returns number

read56

  • read56(): number
  • Reads an 56-bit value from the DataBuffer and advances the Position by 7.

    Returns number

read64

  • read64(): number
  • Reads an 64-bit value from the DataBuffer and advances the Position by 8.

    Returns number

read7

  • read7(): number
  • Reads an 7-bit value from the DataBuffer and advances the BitPosition by 7.

    Returns number

read8

  • read8(): number
  • Reads an 8-bit value from the DataBuffer and advances the Position by 1.

    Returns number

readByte

  • readByte(): number
  • Reads a single byte from the stream and advances the Position by 1.

    Returns number

readBytes

  • readBytes(length: number): Uint8Array
  • Read a specified number of bytes from the DataBuffer and advance the Position by that number.

    Parameters

    • length: number

      The number of bytes to read.

    Returns Uint8Array

setBitPosition

  • setBitPosition(value: number): void
  • Sets the bit position within a byte.

    Parameters

    • value: number

    Returns void

setPosition

  • setPosition(value: number): void
  • Sets the position within the stream.

    Parameters

    • value: number

    Returns void

write

  • write(buffer: DataBuffer): DataBufferStream
  • Writes the specified buffer to the DataBuffer and advances the Position by the length of the buffer.

    Parameters

    • buffer: DataBuffer

      The buffer.

    Returns DataBufferStream

write16

  • write16(value: number): DataBufferStream
  • Writes an 16-bit value to the DataBuffer and advances the Position by 2.

    Parameters

    • value: number

      The value.

    Returns DataBufferStream

write32

  • write32(value: number): DataBufferStream
  • Writes an 32-bit value to the DataBuffer and advances the Position by 4.

    Parameters

    • value: number

      The value.

    Returns DataBufferStream

write64

  • write64(value: number): DataBufferStream
  • Writes an 64-bit value to the DataBuffer and advances the Position by 8.

    Parameters

    • value: number

      The value.

    Returns DataBufferStream

write8

  • write8(value: number): DataBufferStream
  • Writes an 8-bit value to the DataBuffer and advances the Position by 1.

    Parameters

    • value: number

      The value.

    Returns DataBufferStream

writeBytes

  • writeBytes(data: Uint8Array): DataBufferStream
  • writeBytes(data: Uint8Array, index: number, length: number): DataBufferStream
  • Writes the specified data to the DataBuffer and advances the Position by the length of the data.

    Parameters

    • data: Uint8Array

      The data.

    Returns DataBufferStream

  • Writes the specified data to the DataBuffer and advances the Position by the length.

    Parameters

    • data: Uint8Array

      The data.

    • index: number

      The index.

    • length: number

      The length.

    Returns DataBufferStream