/ fm / liveswitch / DataBuffer
Class: DataBuffer
fm.liveswitch.DataBuffer
Binary data buffer implementation
Hierarchy
DataBuffer
Table of contents
Constructors
Methods
- and
- append
- canResize
- clone
- copy
- fmliveswitchDataBufferInit
- free
- getData
- getIndex
- getInnerData
- getIsPooled
- getIsSubset
- getLength
- getLittleEndian
- getTypeString
- keep
- or
- prepend
- read1
- read10
- read10Signed
- read11
- read11Signed
- read12
- read12Signed
- read13
- read13Signed
- read14
- read14Signed
- read15
- read15Signed
- read16
- read16Signed
- read17
- read17Signed
- read18
- read18Signed
- read19
- read19Signed
- read2
- read20
- read20Signed
- read21
- read21Signed
- read22
- read22Signed
- read23
- read23Signed
- read24
- read24Signed
- read2Signed
- read3
- read32
- read32Signed
- read3Signed
- read4
- read40
- read40Signed
- read48
- read48Signed
- read4Signed
- read5
- read56
- read56Signed
- read5Signed
- read6
- read64
- read64Signed
- read6Signed
- read7
- read7Signed
- read8
- read8Signed
- read9
- read9Signed
- readUtf8String
- resize
- sequenceEquals
- sequenceEqualsConstantTime
- set
- setInnerData
- setLittleEndian
- subset
- toArray
- toBytes
- toHexString
- toJson
- tryKeep
- tryRead1
- tryRead10
- tryRead11
- tryRead12
- tryRead13
- tryRead14
- tryRead15
- tryRead16
- tryRead17
- tryRead18
- tryRead19
- tryRead2
- tryRead20
- tryRead21
- tryRead22
- tryRead23
- tryRead24
- tryRead3
- tryRead32
- tryRead4
- tryRead40
- tryRead48
- tryRead5
- tryRead56
- tryRead6
- tryRead64
- tryRead7
- tryRead8
- tryRead9
- write
- write1
- write10
- write11
- write12
- write13
- write14
- write15
- write16
- write16Signed
- write17
- write18
- write19
- write2
- write20
- write21
- write22
- write23
- write24
- write3
- write32
- write4
- write40
- write48
- write5
- write56
- write6
- write64
- write7
- write8
- write9
- writeBytes
- xor
- allocate
- areEqual
- fromBytes
- fromHexString
- fromJson
- fromJsonArray
- getEmpty
- toJson
- toJsonArray
- wrap
Constructors
constructor
+ new DataBuffer(): DataBuffer
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:31
+ new DataBuffer(data
: Uint8Array, index
: number, length
: number, littleEndian
: boolean): DataBuffer
Parameters:
Name | Type |
---|---|
data |
Uint8Array |
index |
number |
length |
number |
littleEndian |
boolean |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:32
Methods
and
▸ and(value
: number, offset
: number): boolean
Performs a bitwise "and" operation on a value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:363
append
▸ append(buffer
: DataBuffer): DataBuffer
Appends a buffer.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:378
▸ append(buffers
: DataBuffer[]): DataBuffer
Appends some buffers.
Parameters:
Name | Type | Description |
---|---|---|
buffers |
DataBuffer[] | The buffers. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:385
canResize
▸ canResize(newLength
: number, offset
: number): boolean
Gets whether this buffer can be resized to the new length.
Parameters:
Name | Type | Description |
---|---|---|
newLength |
number | The new length. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:427
clone
▸ clone(): DataBuffer
Clones this instance.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:462
▸ clone(littleEndian
: boolean): DataBuffer
Clones this instance.
Parameters:
Name | Type | Description |
---|---|---|
littleEndian |
boolean | Whether to clone into a little endian buffer. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:469
copy
▸ copy(): DataBuffer
Copies this instance into new memory.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:485
▸ copy(usePool
: boolean): DataBuffer
Copies this instance.
Parameters:
Name | Type |
---|---|
usePool |
boolean |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:491
fmliveswitchDataBufferInit
▸ Private
fmliveswitchDataBufferInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:25
free
▸ free(): DataBuffer
Decrements the retain count by one and returns the Buffer to the pool if zero.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:514
getData
▸ getData(): Uint8Array
Gets the data.
Returns: Uint8Array
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:526
getIndex
▸ getIndex(): number
Gets the index.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:549
getInnerData
▸ Protected
getInnerData(): Uint8Array
Gets backing data buffer.
Returns: Uint8Array
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:561
getIsPooled
▸ getIsPooled(): boolean
Gets whether this DataBuffer is from a pool.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:573
getIsSubset
▸ getIsSubset(): boolean
Gets whether this DataBuffer is a subset.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:585
getLength
▸ getLength(): number
Gets the length.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:597
getLittleEndian
▸ getLittleEndian(): boolean
Gets whether [[fm.liveswitch.dataBuffer.data]] is little-endian.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:609
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:9
keep
▸ keep(): DataBuffer
Increment the retain count by one.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:621
or
▸ or(value
: number, offset
: number): boolean
Performs a bitwise "or" operation on a value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:635
prepend
▸ prepend(buffer
: DataBuffer): DataBuffer
Prepends a buffer.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:650
▸ prepend(buffers
: DataBuffer[]): void
Prepends some buffers.
Parameters:
Name | Type | Description |
---|---|---|
buffers |
DataBuffer[] | The buffers. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:657
read1
▸ read1(offset
: number, bitOffset
: number): boolean
Reads a 1-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:702
read10
▸ read10(offset
: number, bitOffset
: number): number
Reads a 10-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bitoffset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:718
read10Signed
▸ read10Signed(offset
: number, bitOffset
: number): number
Reads a 10-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:734
read11
▸ read11(offset
: number, bitOffset
: number): number
Reads a 11-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bitoffset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:754
read11Signed
▸ read11Signed(offset
: number, bitOffset
: number): number
Reads a 11-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:770
read12
▸ read12(offset
: number, bitOffset
: number): number
Reads a 12-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bitoffset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:790
read12Signed
▸ read12Signed(offset
: number, bitOffset
: number): number
Reads a 12-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:806
read13
▸ read13(offset
: number, bitOffset
: number): number
Reads a 13-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bitoffset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:826
read13Signed
▸ read13Signed(offset
: number, bitOffset
: number): number
Reads a 13-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:842
read14
▸ read14(offset
: number, bitOffset
: number): number
Reads a 14-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:862
read14Signed
▸ read14Signed(offset
: number, bitOffset
: number): number
Reads a 14-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:878
read15
▸ read15(offset
: number, bitOffset
: number): number
Reads a 15-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:898
read15Signed
▸ read15Signed(offset
: number, bitOffset
: number): number
Reads a 15-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:914
read16
▸ read16(offset
: number): number
Reads a 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:933
▸ read16(offset
: number, offsetPlus
: Holder<number>): number
Reads a 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:941
read16Signed
▸ read16Signed(offset
: number): number
Reads a 16-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:961
▸ read16Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 16-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:969
read17
▸ read17(offset
: number, bitOffset
: number): number
Reads a 17-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:994
read17Signed
▸ read17Signed(offset
: number, bitOffset
: number): number
Reads a 17-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1010
read18
▸ read18(offset
: number, bitOffset
: number): number
Reads an 18-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1030
read18Signed
▸ read18Signed(offset
: number, bitOffset
: number): number
Reads an 18-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1046
read19
▸ read19(offset
: number, bitOffset
: number): number
Reads a 19-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1066
read19Signed
▸ read19Signed(offset
: number, bitOffset
: number): number
Reads a 19-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1082
read2
▸ read2(offset
: number, bitOffset
: number): number
Reads a 2-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1102
read20
▸ read20(offset
: number, bitOffset
: number): number
Reads a 20-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1118
read20Signed
▸ read20Signed(offset
: number, bitOffset
: number): number
Reads a 20-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1134
read21
▸ read21(offset
: number, bitOffset
: number): number
Reads a 21-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1154
read21Signed
▸ read21Signed(offset
: number, bitOffset
: number): number
Reads a 21-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1170
read22
▸ read22(offset
: number, bitOffset
: number): number
Reads a 22-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1190
read22Signed
▸ read22Signed(offset
: number, bitOffset
: number): number
Reads a 22-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1206
read23
▸ read23(offset
: number, bitOffset
: number): number
Reads a 23-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1226
read23Signed
▸ read23Signed(offset
: number, bitOffset
: number): number
Reads a 23-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1242
read24
▸ read24(offset
: number): number
Reads a 24-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1261
▸ read24(offset
: number, offsetPlus
: Holder<number>): number
Reads a 24-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1269
read24Signed
▸ read24Signed(offset
: number): number
Reads a 24-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1289
▸ read24Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 24-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1297
read2Signed
▸ read2Signed(offset
: number, bitOffset
: number): number
Reads a 2-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1322
read3
▸ read3(offset
: number, bitOffset
: number): number
Reads a 3-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1342
read32
▸ read32(offset
: number): number
Reads a 32-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1357
▸ read32(offset
: number, offsetPlus
: Holder<number>): number
Reads a 32-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1365
read32Signed
▸ read32Signed(offset
: number): number
Reads a 32-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1385
▸ read32Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 32-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1393
read3Signed
▸ read3Signed(offset
: number, bitOffset
: number): number
Reads a 3-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1418
read4
▸ read4(offset
: number, bitOffset
: number): number
Reads a 4-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1438
read40
▸ read40(offset
: number): number
Reads a 40-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1453
▸ read40(offset
: number, offsetPlus
: Holder<number>): number
Reads a 40-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1461
read40Signed
▸ read40Signed(offset
: number): number
Reads a 40-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1481
▸ read40Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 40-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1489
read48
▸ read48(offset
: number): number
Reads a 48-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1513
▸ read48(offset
: number, offsetPlus
: Holder<number>): number
Reads a 48-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1521
read48Signed
▸ read48Signed(offset
: number): number
Reads a 48-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1541
▸ read48Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 48-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1549
read4Signed
▸ read4Signed(offset
: number, bitOffset
: number): number
Reads a 4-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1574
read5
▸ read5(offset
: number, bitOffset
: number): number
Reads a 5-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1594
read56
▸ read56(offset
: number): number
Reads a 56-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1609
▸ read56(offset
: number, offsetPlus
: Holder<number>): number
Reads a 56-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1617
read56Signed
▸ read56Signed(offset
: number): number
Reads a 56-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1637
▸ read56Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 56-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1645
read5Signed
▸ read5Signed(offset
: number, bitOffset
: number): number
Reads a 5-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1670
read6
▸ read6(offset
: number, bitOffset
: number): number
Reads a 6-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1690
read64
▸ read64(offset
: number): number
Reads a 64-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1705
▸ read64(offset
: number, offsetPlus
: Holder<number>): number
Reads a 64-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1713
read64Signed
▸ read64Signed(offset
: number): number
Reads a 64-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1733
▸ read64Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads a 64-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1741
read6Signed
▸ read6Signed(offset
: number, bitOffset
: number): number
Reads a 6-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1762
read7
▸ read7(offset
: number, bitOffset
: number): number
Reads a 7-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1782
read7Signed
▸ read7Signed(offset
: number, bitOffset
: number): number
Reads a 7-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1798
read8
▸ read8(offset
: number): number
Reads an 8-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1817
▸ read8(offset
: number, offsetPlus
: Holder<number>): number
Reads an 8-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1825
read8Signed
▸ read8Signed(offset
: number): number
Reads an 8-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1845
▸ read8Signed(offset
: number, offsetPlus
: Holder<number>): number
Reads an 8-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1853
read9
▸ read9(offset
: number, bitOffset
: number): number
Reads a 9-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bitoffset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1878
read9Signed
▸ read9Signed(offset
: number, bitOffset
: number): number
Reads a 9-bit signed value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1894
readUtf8String
▸ readUtf8String(offset
: number): string
Read a UTF-8 string.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1913
▸ readUtf8String(offset
: number, length
: number): string
Reads a UTF-8 string.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
length |
number | The length. |
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1921
resize
▸ resize(newLength
: number): void
Resizes this buffer to a new length with new data being inserted at the end.
Parameters:
Name | Type | Description |
---|---|---|
newLength |
number | The new length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1940
▸ resize(newLength
: number, offset
: number): void
Resizes this buffer to a new length with new data being inserted at a given offset.
Parameters:
Name | Type | Description |
---|---|---|
newLength |
number | The new length. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1948
▸ resize(newLength
: number, offset
: number, setZero
: boolean): void
Resizes this buffer to a new length with new data being inserted at a given offset.
Parameters:
Name | Type | Description |
---|---|---|
newLength |
number | The new length. |
offset |
number | The offset. |
setZero |
boolean | Sets empty space to zero. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:1957
sequenceEquals
▸ sequenceEquals(buffer
: DataBuffer): boolean
Compares a data buffer for equality.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The data buffer. |
Returns: boolean
true
if the sequences are equal; otherwise, false
.
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2046
sequenceEqualsConstantTime
▸ sequenceEqualsConstantTime(buffer
: DataBuffer): boolean
Compares a data buffer for equality in constant time.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: boolean
true
if the sequences are equal; otherwise, false
.
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2061
set
▸ set(value
: number): void
Sets the data buffer to the specified value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2074
▸ set(value
: number, offset
: number): void
Sets a subset of the data buffer to the specified value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2082
▸ set(value
: number, offset
: number, length
: number): void
Sets a subset of the data buffer to the specified value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
length |
number | The length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2091
setInnerData
▸ Protected
setInnerData(value
: Uint8Array): void
Sets backing data buffer.
Parameters:
Name | Type |
---|---|
value |
Uint8Array |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2132
setLittleEndian
▸ setLittleEndian(value
: boolean): void
Sets whether [[fm.liveswitch.dataBuffer.data]] is little-endian.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2153
subset
▸ subset(offset
: number): DataBuffer
Gets a subset of this instance.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2166
▸ subset(offset
: number, length
: number): DataBuffer
Gets a subset of this instance.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
length |
number | The length. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2174
toArray
▸ toArray(): Uint8Array
Converts this instance to an array of bytes.
Returns: Uint8Array
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2198
toBytes
▸ toBytes(): Uint8Array
Converts this instance to an array of bytes.
Returns: Uint8Array
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2210
toHexString
▸ toHexString(): string
Converts this instance to a hexadecimal string.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2224
toJson
▸ toJson(): string
Serializes this instance to JSON.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2236
tryKeep
▸ tryKeep(): boolean
Attempts to increment the retain count by one.
Returns: boolean
True if successful.
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2249
tryRead1
▸ tryRead1(offset
: number, bitOffset
: number, value
: Holder<boolean>): boolean
Tries to read a 1-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<boolean> | if set to true [value]. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2270
tryRead10
▸ tryRead10(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 10-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2288
tryRead11
▸ tryRead11(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read an 11-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2306
tryRead12
▸ tryRead12(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 12-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2324
tryRead13
▸ tryRead13(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 13-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2342
tryRead14
▸ tryRead14(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 14-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2360
tryRead15
▸ tryRead15(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 15-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2378
tryRead16
▸ tryRead16(offset
: number, value
: Holder<number>): boolean
Tries to read a 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2395
tryRead17
▸ tryRead17(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 17-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2412
tryRead18
▸ tryRead18(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read an 18-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2430
tryRead19
▸ tryRead19(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 19-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2448
tryRead2
▸ tryRead2(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 2-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2466
tryRead20
▸ tryRead20(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 20-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2484
tryRead21
▸ tryRead21(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 21-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2502
tryRead22
▸ tryRead22(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 22-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2520
tryRead23
▸ tryRead23(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 23-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2538
tryRead24
▸ tryRead24(offset
: number, value
: Holder<number>): boolean
Tries to read a 24-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2555
tryRead3
▸ tryRead3(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 3-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2572
tryRead32
▸ tryRead32(offset
: number, value
: Holder<number>): boolean
Tries to read a 32-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2589
tryRead4
▸ tryRead4(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 4-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2606
tryRead40
▸ tryRead40(offset
: number, value
: Holder<number>): boolean
Tries to read a 40-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2623
tryRead48
▸ tryRead48(offset
: number, value
: Holder<number>): boolean
Tries to read a 48-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2639
tryRead5
▸ tryRead5(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 5-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2656
tryRead56
▸ tryRead56(offset
: number, value
: Holder<number>): boolean
Tries to read a 56-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2673
tryRead6
▸ tryRead6(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 6-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2690
tryRead64
▸ tryRead64(offset
: number, value
: Holder<number>): boolean
Tries to read a 64-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2707
tryRead7
▸ tryRead7(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 7-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2724
tryRead8
▸ tryRead8(offset
: number, value
: Holder<number>): boolean
Tries to read an 8-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2741
tryRead9
▸ tryRead9(offset
: number, bitOffset
: number, value
: Holder<number>): boolean
Tries to read a 9-bit value.
Parameters:
Name | Type | Description |
---|---|---|
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
value |
Holder<number> | The value. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2758
write
▸ write(buffer
: DataBuffer): void
Writes a data buffer to this instance.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2774
▸ write(buffer
: DataBuffer, offset
: number): void
Writes a data buffer to this instance.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2782
▸ write(buffer
: DataBuffer, offset
: number, offsetPlus
: Holder<number>): void
Writes a data buffer to this instance.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
DataBuffer | The buffer. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the buffer length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2791
write1
▸ write1(value
: boolean, offset
: number, bitOffset
: number): boolean
Writes a 1-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2818
write10
▸ write10(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 10-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2835
write11
▸ write11(value
: number, offset
: number, bitOffset
: number): boolean
Writes an 11-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2853
write12
▸ write12(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 12-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2871
write13
▸ write13(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 13-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2889
write14
▸ write14(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 14-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2907
write15
▸ write15(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 15-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2925
write16
▸ write16(value
: number, offset
: number): boolean
Writes a 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2942
▸ write16(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2951
write16Signed
▸ write16Signed(value
: number, offset
: number): boolean
Writes a signed 16-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2974
write17
▸ write17(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 17-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:2994
write18
▸ write18(value
: number, offset
: number, bitOffset
: number): boolean
Writes an 18-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3012
write19
▸ write19(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 19-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3030
write2
▸ write2(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 2-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3048
write20
▸ write20(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 20-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3066
write21
▸ write21(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 21-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3084
write22
▸ write22(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 22-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3102
write23
▸ write23(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 23-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3120
write24
▸ write24(value
: number, offset
: number): boolean
Writes a 24-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3137
▸ write24(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 24-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3146
write3
▸ write3(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 3-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3170
write32
▸ write32(value
: number, offset
: number): boolean
Writes a 32-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3187
▸ write32(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 32-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3196
write4
▸ write4(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 4-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3220
write40
▸ write40(value
: number, offset
: number): boolean
Writes a 40-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3237
▸ write40(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 40-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3246
write48
▸ write48(value
: number, offset
: number): boolean
Writes a 48-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3269
▸ write48(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 48-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3278
write5
▸ write5(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 5-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3302
write56
▸ write56(value
: number, offset
: number): boolean
Writes a 56-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3319
▸ write56(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 56-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3328
write6
▸ write6(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 6-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3352
write64
▸ write64(value
: number, offset
: number): boolean
Writes a 64-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3369
▸ write64(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes a 64-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3378
write7
▸ write7(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 7-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3402
write8
▸ write8(value
: number, offset
: number): boolean
Writes an 8-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3419
▸ write8(value
: number, offset
: number, offsetPlus
: Holder<number>): boolean
Writes an 8-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the value length. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3428
write9
▸ write9(value
: number, offset
: number, bitOffset
: number): boolean
Writes a 9-bit value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
bitOffset |
number | The bit offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3452
writeBytes
▸ writeBytes(bytes
: Uint8Array): void
Writes a byte array to this instance.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | The bytes. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3468
▸ writeBytes(bytes
: Uint8Array, bytesIndex
: number, bytesLength
: number, offset
: number): void
Writes a byte array to this instance.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | The bytes. |
bytesIndex |
number | The bytes index. |
bytesLength |
number | The bytes length. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3478
▸ writeBytes(bytes
: Uint8Array, bytesIndex
: number, bytesLength
: number, offset
: number, offsetPlus
: Holder<number>): void
Writes a byte array to this instance.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | The bytes. |
bytesIndex |
number | The bytes index. |
bytesLength |
number | The bytes length. |
offset |
number | The offset. |
offsetPlus |
Holder<number> | The offset plus the buffer length. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3489
▸ writeBytes(bytes
: Uint8Array, bytesIndex
: number, offset
: number): void
Writes a byte array to this instance.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | The bytes. |
bytesIndex |
number | The bytes index. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3498
▸ writeBytes(bytes
: Uint8Array, offset
: number): void
Writes a byte array to this instance.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | The bytes. |
offset |
number | The offset. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3506
xor
▸ xor(value
: number, offset
: number): boolean
Performs a bitwise "xor" operation on a value.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value. |
offset |
number | The offset. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:3548
allocate
▸ Static
allocate(count
: number): DataBuffer
Allocates a new data buffer with a given size (in bytes) in big-endian format.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Pre-allocated data buffer size (in bytes). |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:65
▸ Static
allocate(count
: number, littleEndian
: boolean): DataBuffer
Allocates a new data buffer with a given size (in bytes).
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Pre-allocated data buffer size (in bytes). |
littleEndian |
boolean | Whether the data is little-endian. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:73
areEqual
▸ Static
areEqual(buffer1
: DataBuffer, buffer2
: DataBuffer): boolean
Tests if the two buffers have equal contents.
Parameters:
Name | Type | Description |
---|---|---|
buffer1 |
DataBuffer | First buffer to test. |
buffer2 |
DataBuffer | Second buffer to test. |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:94
fromBytes
▸ Static
fromBytes(bytes
: Uint8Array): DataBuffer
Creates an instance from an array of bytes.
Parameters:
Name | Type |
---|---|
bytes |
Uint8Array |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:115
▸ Static
fromBytes(bytes
: Uint8Array, littleEndian
: boolean): DataBuffer
Creates an instance from an array of bytes.
Parameters:
Name | Type |
---|---|
bytes |
Uint8Array |
littleEndian |
boolean |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:121
fromHexString
▸ Static
fromHexString(hexString
: string): DataBuffer
Creates an instance from a hexadecimal string.
Parameters:
Name | Type |
---|---|
hexString |
string |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:140
▸ Static
fromHexString(hexString
: string, littleEndian
: boolean): DataBuffer
Creates an instance from a hexadecimal string.
Parameters:
Name | Type |
---|---|
hexString |
string |
littleEndian |
boolean |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:146
fromJson
▸ Static
fromJson(dataBufferJson
: string): DataBuffer
Deserializes an instance from JSON.
Parameters:
Name | Type | Description |
---|---|---|
dataBufferJson |
string | The data buffer JSON. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:166
fromJsonArray
▸ Static
fromJsonArray(dataBuffersJson
: string): DataBuffer[]
Deserializes an array of instances from JSON.
Parameters:
Name | Type | Description |
---|---|---|
dataBuffersJson |
string | The data buffers JSON. |
Returns: DataBuffer[]
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:201
getEmpty
▸ Static
getEmpty(): DataBuffer
Gets an empty data buffer.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:218
toJson
▸ Static
toJson(dataBuffer
: DataBuffer): string
Serializes an instance to JSON.
Parameters:
Name | Type | Description |
---|---|---|
dataBuffer |
DataBuffer | The data buffer. |
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:232
toJsonArray
▸ Static
toJsonArray(dataBuffers
: DataBuffer[]): string
Serializes an array of instances to JSON.
Parameters:
Name | Type | Description |
---|---|---|
dataBuffers |
DataBuffer[] | The data buffers. |
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:252
wrap
▸ Static
wrap(data
: Uint8Array): DataBuffer
Produces a new data buffer containing supplied data in big-endian format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:267
▸ Static
wrap(data
: Uint8Array, index
: number): DataBuffer
Produces a new data buffer containing supplied data in big-endian format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
index |
number | The index. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:276
▸ Static
wrap(data
: Uint8Array, index
: number, length
: number): DataBuffer
Produces a new data buffer containing supplied data in big-endian format.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
index |
number | The index. |
length |
number | The length. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:286
▸ Static
wrap(data
: Uint8Array, index
: number, length
: number, littleEndian
: boolean): DataBuffer
Produces a new data buffer containing supplied data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
index |
number | The index. |
length |
number | The length. |
littleEndian |
boolean | Whether the data is little-endian. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:296
▸ Static
wrap(data
: Uint8Array, index
: number, littleEndian
: boolean): DataBuffer
Produces a new data buffer containing supplied data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
index |
number | The index. |
littleEndian |
boolean | Whether the data is little-endian. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:305
▸ Static
wrap(data
: Uint8Array, littleEndian
: boolean): DataBuffer
Produces a new data buffer containing supplied data.
Parameters:
Name | Type | Description |
---|---|---|
data |
Uint8Array | The data. |
littleEndian |
boolean | Whether the data is little-endian. |
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/DataBuffer.ts:313