/ fm / liveswitch / DataBufferStream
Class: DataBufferStream
fm.liveswitch.DataBufferStream
A data buffer stream.
Table of contents
Constructors
Methods
- fmliveswitchDataBufferStreamInit
- getAvailable
- getBitPosition
- getBuffer
- getLength
- getPosition
- getTypeString
- nextByte
- peek
- read
- read1
- read15
- read16
- read2
- read24
- read3
- read32
- read4
- read40
- read48
- read56
- read64
- read7
- read8
- readByte
- readBytes
- setBitPosition
- setPosition
- write
- write16
- write32
- write64
- write8
- writeBytes
Constructors
constructor
+ new DataBufferStream(buffer
: DataBuffer): DataBufferStream
Initializes a new instance of the [[fm.liveswitch.dataBufferStream]] class.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:23
+ new DataBufferStream(dataBufferSize
: number): DataBufferStream
Initializes a new instance of the [[fm.liveswitch.dataBufferStream]] class.
Parameters:
Name | Type | Description |
---|---|---|
dataBufferSize |
number | Size of the data buffer. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:30
+ new DataBufferStream(dataBufferSize
: number, littleEndian
: boolean): DataBufferStream
Initializes a new instance of the [[fm.liveswitch.dataBufferStream]] class.
Parameters:
Name | Type | Description |
---|---|---|
dataBufferSize |
number | Size of the data buffer. |
littleEndian |
boolean | Whether the data is little-endian. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:37
Methods
fmliveswitchDataBufferStreamInit
▸ Private
fmliveswitchDataBufferStreamInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:19
getAvailable
▸ getAvailable(): number
Gets the available bytes to be read from the DataBuffer.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:96
getBitPosition
▸ getBitPosition(): number
Gets the bit position within a byte.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:108
getBuffer
▸ getBuffer(): DataBuffer
Gets the buffer.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:120
getLength
▸ getLength(): number
Gets the buffer length.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:132
getPosition
▸ getPosition(): number
Gets the position within the stream.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:144
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:9
nextByte
▸ nextByte(): void
Resets the bit count to 0 and advances to the next byte.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:156
peek
▸ peek(): number
Reads an 8-bit value from the DataBuffer without advancing the Position.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:169
read
▸ read(length
: number): DataBuffer
Reads the specified length from the DataBuffer and advances the position by the length.
Parameters:
Name | Type | Description |
---|---|---|
length |
number | The length. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:182
read1
▸ read1(): boolean
Read a single bit and advance the bit position by 1.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:197
read15
▸ read15(): number
Reads an 15-bit value from the DataBuffer and advances the Position by 1 and the BitPosition by 7.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:215
read16
▸ read16(): number
Reads an 16-bit value from the DataBuffer and advances the Position by 2.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:234
read2
▸ read2(): number
Read a 2-bit value and advance the BitPosition by 2.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:248
read24
▸ read24(): number
Reads an 24-bit value from the DataBuffer and advances the Position by 3.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:266
read3
▸ read3(): number
Read a 3-bit value and advance the BitPosition by 3.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:280
read32
▸ read32(): number
Reads an 32-bit value from the DataBuffer and advances the Position by 4.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:298
read4
▸ read4(): number
Read a 4-bit value and advance the BitPosition by 4.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:312
read40
▸ read40(): number
Reads an 40-bit value from the DataBuffer and advances the Position by 5.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:330
read48
▸ read48(): number
Reads an 48-bit value from the DataBuffer and advances the Position by 6.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:344
read56
▸ read56(): number
Reads an 56-bit value from the DataBuffer and advances the Position by 7.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:358
read64
▸ read64(): number
Reads an 64-bit value from the DataBuffer and advances the Position by 8.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:372
read7
▸ read7(): number
Reads an 7-bit value from the DataBuffer and advances the BitPosition by 7.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:386
read8
▸ read8(): number
Reads an 8-bit value from the DataBuffer and advances the Position by 1.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:404
readByte
▸ readByte(): number
Reads a single byte from the stream and advances the Position by 1.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:418
readBytes
▸ readBytes(length
: number): Uint8Array
Read a specified number of bytes from the DataBuffer and advance the Position by that number.
Parameters:
Name | Type | Description |
---|---|---|
length |
number | The number of bytes to read. |
Returns: Uint8Array
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:431
setBitPosition
▸ setBitPosition(value
: number): void
Sets the bit position within a byte.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:446
setPosition
▸ setPosition(value
: number): void
Sets the position within the stream.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:459
write
▸ write(buffer
: DataBuffer): DataBufferStream
Writes the specified buffer to the DataBuffer and advances the Position by the length of the buffer.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:473
write16
▸ write16(value
: number): DataBufferStream
Writes an 16-bit value to the DataBuffer and advances the Position by 2.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:488
write32
▸ write32(value
: number): DataBufferStream
Writes an 32-bit value to the DataBuffer and advances the Position by 4.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:504
write64
▸ write64(value
: number): DataBufferStream
Writes an 64-bit value to the DataBuffer and advances the Position by 8.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:520
write8
▸ write8(value
: number): DataBufferStream
Writes an 8-bit value to the DataBuffer and advances the Position by 1.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:536
writeBytes
▸ writeBytes(data
: Uint8Array): DataBufferStream
Writes the specified data to the DataBuffer and advances the Position by the length of the data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:552
▸ writeBytes(data
: Uint8Array, index
: number, length
: number): DataBufferStream
Writes the specified data to the DataBuffer and advances the Position by the length.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
index |
number | The index. |
length |
number | The length. |
Returns: DataBufferStream
Defined in: Generated/TypeScript/fm.liveswitch/DataBufferStream.ts:561