fm.liveswitch.DataBuffer Class Reference

Binary data buffer implementation. More...

Public Member Functions

boolean and (int value, int offset)
 Performs a bitwise "and" operation on a value. More...
 
fm.liveswitch.DataBuffer append (fm.liveswitch.DataBuffer buffer)
 Appends a buffer. More...
 
fm.liveswitch.DataBuffer append (fm.liveswitch.DataBuffer[] buffers)
 Appends some buffers. More...
 
boolean canResize (int newLength, int offset)
 Gets whether this buffer can be resized to the new length. More...
 
fm.liveswitch.DataBuffer clone ()
 Clones this instance. More...
 
fm.liveswitch.DataBuffer clone (boolean littleEndian)
 Clones this instance. More...
 
fm.liveswitch.DataBuffer copy ()
 Copies this instance into new memory. More...
 
fm.liveswitch.DataBuffer copy (boolean usePool)
 Copies this instance. More...
 
fm.liveswitch.DataBuffer free ()
 Decrements the retain count by one and returns the Buffer to the pool if zero. More...
 
byte[] getData ()
 Gets the data. More...
 
int getIndex ()
 Gets the index. More...
 
boolean getIsPooled ()
 Gets whether this DataBuffer is from a pool. More...
 
boolean getIsSubset ()
 Gets whether this DataBuffer is a subset. More...
 
int getLength ()
 Gets the length. More...
 
boolean getLittleEndian ()
 Gets whether fm.liveswitch.DataBuffer#getData is little-endian. More...
 
fm.liveswitch.DataBuffer keep ()
 Increment the retain count by one. More...
 
boolean or (int value, int offset)
 Performs a bitwise "or" operation on a value. More...
 
fm.liveswitch.DataBuffer prepend (fm.liveswitch.DataBuffer buffer)
 Prepends a buffer. More...
 
void prepend (fm.liveswitch.DataBuffer[] buffers)
 Prepends some buffers. More...
 
boolean read1 (int offset, int bitOffset)
 Reads a 1-bit value. More...
 
int read10 (int offset, int bitOffset)
 Reads a 10-bit value. More...
 
int read10Signed (int offset, int bitOffset)
 Reads a 10-bit signed value. More...
 
int read11 (int offset, int bitOffset)
 Reads a 11-bit value. More...
 
int read11Signed (int offset, int bitOffset)
 Reads a 11-bit signed value. More...
 
int read12 (int offset, int bitOffset)
 Reads a 12-bit value. More...
 
int read12Signed (int offset, int bitOffset)
 Reads a 12-bit signed value. More...
 
int read13 (int offset, int bitOffset)
 Reads a 13-bit value. More...
 
int read13Signed (int offset, int bitOffset)
 Reads a 13-bit signed value. More...
 
int read14 (int offset, int bitOffset)
 Reads a 14-bit value. More...
 
int read14Signed (int offset, int bitOffset)
 Reads a 14-bit signed value. More...
 
int read15 (int offset, int bitOffset)
 Reads a 15-bit value. More...
 
int read15Signed (int offset, int bitOffset)
 Reads a 15-bit signed value. More...
 
int read16 (int offset)
 Reads a 16-bit value. More...
 
int read16 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 16-bit value. More...
 
int read16Signed (int offset)
 Reads a 16-bit signed value. More...
 
int read16Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 16-bit signed value. More...
 
int read17 (int offset, int bitOffset)
 Reads a 17-bit value. More...
 
int read17Signed (int offset, int bitOffset)
 Reads a 17-bit signed value. More...
 
int read18 (int offset, int bitOffset)
 Reads an 18-bit value. More...
 
int read18Signed (int offset, int bitOffset)
 Reads an 18-bit signed value. More...
 
int read19 (int offset, int bitOffset)
 Reads a 19-bit value. More...
 
int read19Signed (int offset, int bitOffset)
 Reads a 19-bit signed value. More...
 
int read2 (int offset, int bitOffset)
 Reads a 2-bit value. More...
 
int read20 (int offset, int bitOffset)
 Reads a 20-bit value. More...
 
int read20Signed (int offset, int bitOffset)
 Reads a 20-bit signed value. More...
 
int read21 (int offset, int bitOffset)
 Reads a 21-bit value. More...
 
int read21Signed (int offset, int bitOffset)
 Reads a 21-bit signed value. More...
 
int read22 (int offset, int bitOffset)
 Reads a 22-bit value. More...
 
int read22Signed (int offset, int bitOffset)
 Reads a 22-bit signed value. More...
 
int read23 (int offset, int bitOffset)
 Reads a 23-bit value. More...
 
int read23Signed (int offset, int bitOffset)
 Reads a 23-bit signed value. More...
 
int read24 (int offset)
 Reads a 24-bit value. More...
 
int read24 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 24-bit value. More...
 
int read24Signed (int offset)
 Reads a 24-bit signed value. More...
 
int read24Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 24-bit signed value. More...
 
int read2Signed (int offset, int bitOffset)
 Reads a 2-bit signed value. More...
 
int read3 (int offset, int bitOffset)
 Reads a 3-bit value. More...
 
long read32 (int offset)
 Reads a 32-bit value. More...
 
long read32 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 32-bit value. More...
 
long read32Signed (int offset)
 Reads a 32-bit signed value. More...
 
long read32Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 32-bit signed value. More...
 
int read3Signed (int offset, int bitOffset)
 Reads a 3-bit signed value. More...
 
int read4 (int offset, int bitOffset)
 Reads a 4-bit value. More...
 
long read40 (int offset)
 Reads a 40-bit value. More...
 
long read40 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 40-bit value. More...
 
long read40Signed (int offset)
 Reads a 40-bit signed value. More...
 
long read40Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 40-bit signed value. More...
 
long read48 (int offset)
 Reads a 48-bit value. More...
 
long read48 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 48-bit value. More...
 
long read48Signed (int offset)
 Reads a 48-bit signed value. More...
 
long read48Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 48-bit signed value. More...
 
int read4Signed (int offset, int bitOffset)
 Reads a 4-bit signed value. More...
 
int read5 (int offset, int bitOffset)
 Reads a 5-bit value. More...
 
long read56 (int offset)
 Reads a 56-bit value. More...
 
long read56 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 56-bit value. More...
 
long read56Signed (int offset)
 Reads a 56-bit signed value. More...
 
long read56Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 56-bit signed value. More...
 
int read5Signed (int offset, int bitOffset)
 Reads a 5-bit signed value. More...
 
int read6 (int offset, int bitOffset)
 Reads a 6-bit value. More...
 
long read64 (int offset)
 Reads a 64-bit value. More...
 
long read64 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 64-bit value. More...
 
long read64Signed (int offset)
 Reads a 64-bit signed value. More...
 
long read64Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads a 64-bit signed value. More...
 
int read6Signed (int offset, int bitOffset)
 Reads a 6-bit signed value. More...
 
int read7 (int offset, int bitOffset)
 Reads a 7-bit value. More...
 
int read7Signed (int offset, int bitOffset)
 Reads a 7-bit signed value. More...
 
int read8 (int offset)
 Reads an 8-bit value. More...
 
int read8 (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads an 8-bit value. More...
 
int read8Signed (int offset)
 Reads an 8-bit signed value. More...
 
int read8Signed (int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Reads an 8-bit signed value. More...
 
int read9 (int offset, int bitOffset)
 Reads a 9-bit value. More...
 
int read9Signed (int offset, int bitOffset)
 Reads a 9-bit signed value. More...
 
String readUtf8String (int offset)
 Read a UTF-8 string. More...
 
String readUtf8String (int offset, int length)
 Reads a UTF-8 string. More...
 
void resize (int newLength)
 Resizes this buffer to a new length with new data being inserted at the end. More...
 
void resize (int newLength, int offset)
 Resizes this buffer to a new length with new data being inserted at a given offset. More...
 
void resize (int newLength, int offset, boolean setZero)
 Resizes this buffer to a new length with new data being inserted at a given offset. More...
 
boolean sequenceEquals (fm.liveswitch.DataBuffer buffer)
 Compares a data buffer for equality. More...
 
boolean sequenceEqualsConstantTime (fm.liveswitch.DataBuffer buffer)
 Compares a data buffer for equality in constant time. More...
 
void set (byte value)
 Sets the data buffer to the specified value. More...
 
void set (byte value, int offset)
 Sets a subset of the data buffer to the specified value. More...
 
void set (byte value, int offset, int length)
 Sets a subset of the data buffer to the specified value. More...
 
void setLittleEndian (boolean value)
 Sets whether fm.liveswitch.DataBuffer#getData is little-endian. More...
 
fm.liveswitch.DataBuffer subset (int offset)
 Gets a subset of this instance. More...
 
fm.liveswitch.DataBuffer subset (int offset, int length)
 Gets a subset of this instance. More...
 
byte[] toArray ()
 Converts this instance to an array of bytes. More...
 
byte[] toBytes ()
 Converts this instance to an array of bytes. More...
 
String toHexString ()
 Converts this instance to a hexadecimal string. More...
 
String toJson ()
 Serializes this instance to JSON. More...
 
boolean tryKeep ()
 Attempts to increment the retain count by one. More...
 
boolean tryRead1 (int offset, int bitOffset, fm.liveswitch.BooleanHolder value)
 Tries to read a 1-bit value. More...
 
boolean tryRead10 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 10-bit value. More...
 
boolean tryRead11 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read an 11-bit value. More...
 
boolean tryRead12 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 12-bit value. More...
 
boolean tryRead13 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 13-bit value. More...
 
boolean tryRead14 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 14-bit value. More...
 
boolean tryRead15 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 15-bit value. More...
 
boolean tryRead16 (int offset, fm.liveswitch.IntegerHolder value)
 Tries to read a 16-bit value. More...
 
boolean tryRead17 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 17-bit value. More...
 
boolean tryRead18 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read an 18-bit value. More...
 
boolean tryRead19 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 19-bit value. More...
 
boolean tryRead2 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 2-bit value. More...
 
boolean tryRead20 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 20-bit value. More...
 
boolean tryRead21 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 21-bit value. More...
 
boolean tryRead22 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 22-bit value. More...
 
boolean tryRead23 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 23-bit value. More...
 
boolean tryRead24 (int offset, fm.liveswitch.IntegerHolder value)
 Tries to read a 24-bit value. More...
 
boolean tryRead3 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 3-bit value. More...
 
boolean tryRead32 (int offset, fm.liveswitch.LongHolder value)
 Tries to read a 32-bit value. More...
 
boolean tryRead4 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 4-bit value. More...
 
boolean tryRead40 (int offset, fm.liveswitch.LongHolder value)
 Tries to read a 40-bit value. More...
 
boolean tryRead48 (int offset, fm.liveswitch.LongHolder value)
 Tries to read a 48-bit value. More...
 
boolean tryRead5 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 5-bit value. More...
 
boolean tryRead56 (int offset, fm.liveswitch.LongHolder value)
 Tries to read a 56-bit value. More...
 
boolean tryRead6 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 6-bit value. More...
 
boolean tryRead64 (int offset, fm.liveswitch.LongHolder value)
 Tries to read a 64-bit value. More...
 
boolean tryRead7 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 7-bit value. More...
 
boolean tryRead8 (int offset, fm.liveswitch.IntegerHolder value)
 Tries to read an 8-bit value. More...
 
boolean tryRead9 (int offset, int bitOffset, fm.liveswitch.IntegerHolder value)
 Tries to read a 9-bit value. More...
 
void write (fm.liveswitch.DataBuffer buffer)
 Writes a data buffer to this instance. More...
 
void write (fm.liveswitch.DataBuffer buffer, int offset)
 Writes a data buffer to this instance. More...
 
void write (fm.liveswitch.DataBuffer buffer, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a data buffer to this instance. More...
 
boolean write1 (boolean value, int offset, int bitOffset)
 Writes a 1-bit value. More...
 
boolean write10 (int value, int offset, int bitOffset)
 Writes a 10-bit value. More...
 
boolean write11 (int value, int offset, int bitOffset)
 Writes an 11-bit value. More...
 
boolean write12 (int value, int offset, int bitOffset)
 Writes a 12-bit value. More...
 
boolean write13 (int value, int offset, int bitOffset)
 Writes a 13-bit value. More...
 
boolean write14 (int value, int offset, int bitOffset)
 Writes a 14-bit value. More...
 
boolean write15 (int value, int offset, int bitOffset)
 Writes a 15-bit value. More...
 
boolean write16 (int value, int offset)
 Writes a 16-bit value. More...
 
boolean write16 (int value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 16-bit value. More...
 
boolean write16Signed (int value, int offset)
 Writes a signed 16-bit value. More...
 
boolean write17 (int value, int offset, int bitOffset)
 Writes a 17-bit value. More...
 
boolean write18 (int value, int offset, int bitOffset)
 Writes an 18-bit value. More...
 
boolean write19 (int value, int offset, int bitOffset)
 Writes a 19-bit value. More...
 
boolean write2 (int value, int offset, int bitOffset)
 Writes a 2-bit value. More...
 
boolean write20 (int value, int offset, int bitOffset)
 Writes a 20-bit value. More...
 
boolean write21 (int value, int offset, int bitOffset)
 Writes a 21-bit value. More...
 
boolean write22 (int value, int offset, int bitOffset)
 Writes a 22-bit value. More...
 
boolean write23 (int value, int offset, int bitOffset)
 Writes a 23-bit value. More...
 
boolean write24 (int value, int offset)
 Writes a 24-bit value. More...
 
boolean write24 (int value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 24-bit value. More...
 
boolean write3 (int value, int offset, int bitOffset)
 Writes a 3-bit value. More...
 
boolean write32 (long value, int offset)
 Writes a 32-bit value. More...
 
boolean write32 (long value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 32-bit value. More...
 
boolean write4 (int value, int offset, int bitOffset)
 Writes a 4-bit value. More...
 
boolean write40 (long value, int offset)
 Writes a 40-bit value. More...
 
boolean write40 (long value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 40-bit value. More...
 
boolean write48 (long value, int offset)
 Writes a 48-bit value. More...
 
boolean write48 (long value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 48-bit value. More...
 
boolean write5 (int value, int offset, int bitOffset)
 Writes a 5-bit value. More...
 
boolean write56 (long value, int offset)
 Writes a 56-bit value. More...
 
boolean write56 (long value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 56-bit value. More...
 
boolean write6 (int value, int offset, int bitOffset)
 Writes a 6-bit value. More...
 
boolean write64 (long value, int offset)
 Writes a 64-bit value. More...
 
boolean write64 (long value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a 64-bit value. More...
 
boolean write7 (int value, int offset, int bitOffset)
 Writes a 7-bit value. More...
 
boolean write8 (int value, int offset)
 Writes an 8-bit value. More...
 
boolean write8 (int value, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes an 8-bit value. More...
 
boolean write9 (int value, int offset, int bitOffset)
 Writes a 9-bit value. More...
 
void writeBytes (byte[] bytes)
 Writes a byte array to this instance. More...
 
void writeBytes (byte[] bytes, int bytesIndex, int bytesLength, int offset)
 Writes a byte array to this instance. More...
 
void writeBytes (byte[] bytes, int bytesIndex, int bytesLength, int offset, fm.liveswitch.IntegerHolder offsetPlus)
 Writes a byte array to this instance. More...
 
void writeBytes (byte[] bytes, int bytesIndex, int offset)
 Writes a byte array to this instance. More...
 
void writeBytes (byte[] bytes, int offset)
 Writes a byte array to this instance. More...
 
boolean xor (int value, int offset)
 Performs a bitwise "xor" operation on a value. More...
 

Static Public Member Functions

static fm.liveswitch.DataBuffer allocate (int count)
 Allocates a new data buffer with a given size (in bytes) in big-endian format. More...
 
static fm.liveswitch.DataBuffer allocate (int count, boolean littleEndian)
 Allocates a new data buffer with a given size (in bytes). More...
 
static boolean areEqual (fm.liveswitch.DataBuffer buffer1, fm.liveswitch.DataBuffer buffer2)
 Tests if the two buffers have equal contents. More...
 
static fm.liveswitch.DataBuffer fromBytes (byte[] bytes)
 Creates an instance from an array of bytes. More...
 
static fm.liveswitch.DataBuffer fromBytes (byte[] bytes, boolean littleEndian)
 Creates an instance from an array of bytes. More...
 
static fm.liveswitch.DataBuffer fromHexString (String hexString)
 Creates an instance from a hexadecimal string. More...
 
static fm.liveswitch.DataBuffer fromHexString (String hexString, boolean littleEndian)
 Creates an instance from a hexadecimal string. More...
 
static fm.liveswitch.DataBuffer fromJson (String dataBufferJson)
 Deserializes an instance from JSON. More...
 
static fm.liveswitch.DataBuffer[] fromJsonArray (String dataBuffersJson)
 Deserializes an array of instances from JSON. More...
 
static fm.liveswitch.DataBuffer getEmpty ()
 Gets an empty data buffer. More...
 
static String toJson (final fm.liveswitch.DataBuffer dataBuffer)
 Serializes an instance to JSON. More...
 
static String toJsonArray (fm.liveswitch.DataBuffer[] dataBuffers)
 Serializes an array of instances to JSON. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data)
 Produces a new data buffer containing supplied data in big-endian format. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data, int index)
 Produces a new data buffer containing supplied data in big-endian format. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data, int index, int length)
 Produces a new data buffer containing supplied data in big-endian format. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data, int index, int length, boolean littleEndian)
 Produces a new data buffer containing supplied data. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data, int index, boolean littleEndian)
 Produces a new data buffer containing supplied data. More...
 
static fm.liveswitch.DataBuffer wrap (byte[] data, boolean littleEndian)
 Produces a new data buffer containing supplied data. More...
 

Protected Member Functions

byte[] getInnerData ()
 Gets backing data buffer. More...
 
void setIndex (int value)
 Sets the index. More...
 
void setInnerData (byte[] value)
 Sets backing data buffer. More...
 
void setLength (int value)
 Sets the length. More...
 

Detailed Description

Binary data buffer implementation.

Member Function Documentation

◆ allocate() [1/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.allocate ( int  count)
static

Allocates a new data buffer with a given size (in bytes) in big-endian format.

Parameters
countPre-allocated data buffer size (in bytes).

◆ allocate() [2/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.allocate ( int  count,
boolean  littleEndian 
)
static

Allocates a new data buffer with a given size (in bytes).

Parameters
countPre-allocated data buffer size (in bytes).
littleEndianWhether the data is little-endian.

◆ and()

boolean fm.liveswitch.DataBuffer.and ( int  value,
int  offset 
)

Performs a bitwise "and" operation on a value.

Parameters
valueThe value.
offsetThe offset.

◆ append() [1/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.append ( fm.liveswitch.DataBuffer  buffer)

Appends a buffer.

Parameters
bufferThe buffer.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ append() [2/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.append ( fm.liveswitch.DataBuffer[]  buffers)

Appends some buffers.

Parameters
buffersThe buffers.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ areEqual()

static boolean fm.liveswitch.DataBuffer.areEqual ( fm.liveswitch.DataBuffer  buffer1,
fm.liveswitch.DataBuffer  buffer2 
)
static

Tests if the two buffers have equal contents.

Parameters
buffer1First buffer to test.
buffer2Second buffer to test.

◆ canResize()

boolean fm.liveswitch.DataBuffer.canResize ( int  newLength,
int  offset 
)

Gets whether this buffer can be resized to the new length.

Parameters
newLengthThe new length.
offsetThe offset.

◆ clone() [1/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.clone ( )

Clones this instance.

◆ clone() [2/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.clone ( boolean  littleEndian)

Clones this instance.

Parameters
littleEndianWhether to clone into a little endian buffer.

◆ copy() [1/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.copy ( )

Copies this instance into new memory.

◆ copy() [2/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.copy ( boolean  usePool)

Copies this instance.

◆ free()

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.free ( )

Decrements the retain count by one and returns the Buffer to the pool if zero.

Reimplemented in fm.liveswitch.DataBufferSubset, and fm.liveswitch.CircularDataBuffer.

◆ fromBytes() [1/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.fromBytes ( byte[]  bytes)
static

Creates an instance from an array of bytes.

◆ fromBytes() [2/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.fromBytes ( byte[]  bytes,
boolean  littleEndian 
)
static

Creates an instance from an array of bytes.

◆ fromHexString() [1/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.fromHexString ( String  hexString)
static

Creates an instance from a hexadecimal string.

◆ fromHexString() [2/2]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.fromHexString ( String  hexString,
boolean  littleEndian 
)
static

Creates an instance from a hexadecimal string.

◆ fromJson()

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.fromJson ( String  dataBufferJson)
static

Deserializes an instance from JSON.

Parameters
dataBufferJsonThe data buffer JSON.

◆ fromJsonArray()

static fm.liveswitch.DataBuffer [] fm.liveswitch.DataBuffer.fromJsonArray ( String  dataBuffersJson)
static

Deserializes an array of instances from JSON.

Parameters
dataBuffersJsonThe data buffers JSON.

◆ getData()

byte [] fm.liveswitch.DataBuffer.getData ( )

◆ getEmpty()

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.getEmpty ( )
static

Gets an empty data buffer.

◆ getIndex()

int fm.liveswitch.DataBuffer.getIndex ( )

Gets the index.

◆ getInnerData()

byte [] fm.liveswitch.DataBuffer.getInnerData ( )
protected

Gets backing data buffer.

◆ getIsPooled()

boolean fm.liveswitch.DataBuffer.getIsPooled ( )

Gets whether this DataBuffer is from a pool.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ getIsSubset()

boolean fm.liveswitch.DataBuffer.getIsSubset ( )

Gets whether this DataBuffer is a subset.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ getLength()

int fm.liveswitch.DataBuffer.getLength ( )

Gets the length.

◆ getLittleEndian()

boolean fm.liveswitch.DataBuffer.getLittleEndian ( )

Gets whether fm.liveswitch.DataBuffer#getData is little-endian.

◆ keep()

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.keep ( )

Increment the retain count by one.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ or()

boolean fm.liveswitch.DataBuffer.or ( int  value,
int  offset 
)

Performs a bitwise "or" operation on a value.

Parameters
valueThe value.
offsetThe offset.

◆ prepend() [1/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.prepend ( fm.liveswitch.DataBuffer  buffer)

Prepends a buffer.

Parameters
bufferThe buffer.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ prepend() [2/2]

void fm.liveswitch.DataBuffer.prepend ( fm.liveswitch.DataBuffer[]  buffers)

Prepends some buffers.

Parameters
buffersThe buffers.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ read1()

boolean fm.liveswitch.DataBuffer.read1 ( int  offset,
int  bitOffset 
)

Reads a 1-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read10()

int fm.liveswitch.DataBuffer.read10 ( int  offset,
int  bitOffset 
)

Reads a 10-bit value.

Parameters
offsetThe offset.
bitOffsetThe bitoffset.

◆ read10Signed()

int fm.liveswitch.DataBuffer.read10Signed ( int  offset,
int  bitOffset 
)

Reads a 10-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read11()

int fm.liveswitch.DataBuffer.read11 ( int  offset,
int  bitOffset 
)

Reads a 11-bit value.

Parameters
offsetThe offset.
bitOffsetThe bitoffset.

◆ read11Signed()

int fm.liveswitch.DataBuffer.read11Signed ( int  offset,
int  bitOffset 
)

Reads a 11-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read12()

int fm.liveswitch.DataBuffer.read12 ( int  offset,
int  bitOffset 
)

Reads a 12-bit value.

Parameters
offsetThe offset.
bitOffsetThe bitoffset.

◆ read12Signed()

int fm.liveswitch.DataBuffer.read12Signed ( int  offset,
int  bitOffset 
)

Reads a 12-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read13()

int fm.liveswitch.DataBuffer.read13 ( int  offset,
int  bitOffset 
)

Reads a 13-bit value.

Parameters
offsetThe offset.
bitOffsetThe bitoffset.

◆ read13Signed()

int fm.liveswitch.DataBuffer.read13Signed ( int  offset,
int  bitOffset 
)

Reads a 13-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read14()

int fm.liveswitch.DataBuffer.read14 ( int  offset,
int  bitOffset 
)

Reads a 14-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read14Signed()

int fm.liveswitch.DataBuffer.read14Signed ( int  offset,
int  bitOffset 
)

Reads a 14-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read15()

int fm.liveswitch.DataBuffer.read15 ( int  offset,
int  bitOffset 
)

Reads a 15-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read15Signed()

int fm.liveswitch.DataBuffer.read15Signed ( int  offset,
int  bitOffset 
)

Reads a 15-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read16() [1/2]

int fm.liveswitch.DataBuffer.read16 ( int  offset)

Reads a 16-bit value.

Parameters
offsetThe offset.

◆ read16() [2/2]

int fm.liveswitch.DataBuffer.read16 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 16-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read16Signed() [1/2]

int fm.liveswitch.DataBuffer.read16Signed ( int  offset)

Reads a 16-bit signed value.

Parameters
offsetThe offset.

◆ read16Signed() [2/2]

int fm.liveswitch.DataBuffer.read16Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 16-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read17()

int fm.liveswitch.DataBuffer.read17 ( int  offset,
int  bitOffset 
)

Reads a 17-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read17Signed()

int fm.liveswitch.DataBuffer.read17Signed ( int  offset,
int  bitOffset 
)

Reads a 17-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read18()

int fm.liveswitch.DataBuffer.read18 ( int  offset,
int  bitOffset 
)

Reads an 18-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read18Signed()

int fm.liveswitch.DataBuffer.read18Signed ( int  offset,
int  bitOffset 
)

Reads an 18-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read19()

int fm.liveswitch.DataBuffer.read19 ( int  offset,
int  bitOffset 
)

Reads a 19-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read19Signed()

int fm.liveswitch.DataBuffer.read19Signed ( int  offset,
int  bitOffset 
)

Reads a 19-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read2()

int fm.liveswitch.DataBuffer.read2 ( int  offset,
int  bitOffset 
)

Reads a 2-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read20()

int fm.liveswitch.DataBuffer.read20 ( int  offset,
int  bitOffset 
)

Reads a 20-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read20Signed()

int fm.liveswitch.DataBuffer.read20Signed ( int  offset,
int  bitOffset 
)

Reads a 20-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read21()

int fm.liveswitch.DataBuffer.read21 ( int  offset,
int  bitOffset 
)

Reads a 21-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read21Signed()

int fm.liveswitch.DataBuffer.read21Signed ( int  offset,
int  bitOffset 
)

Reads a 21-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read22()

int fm.liveswitch.DataBuffer.read22 ( int  offset,
int  bitOffset 
)

Reads a 22-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read22Signed()

int fm.liveswitch.DataBuffer.read22Signed ( int  offset,
int  bitOffset 
)

Reads a 22-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read23()

int fm.liveswitch.DataBuffer.read23 ( int  offset,
int  bitOffset 
)

Reads a 23-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read23Signed()

int fm.liveswitch.DataBuffer.read23Signed ( int  offset,
int  bitOffset 
)

Reads a 23-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read24() [1/2]

int fm.liveswitch.DataBuffer.read24 ( int  offset)

Reads a 24-bit value.

Parameters
offsetThe offset.

◆ read24() [2/2]

int fm.liveswitch.DataBuffer.read24 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 24-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read24Signed() [1/2]

int fm.liveswitch.DataBuffer.read24Signed ( int  offset)

Reads a 24-bit signed value.

Parameters
offsetThe offset.

◆ read24Signed() [2/2]

int fm.liveswitch.DataBuffer.read24Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 24-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read2Signed()

int fm.liveswitch.DataBuffer.read2Signed ( int  offset,
int  bitOffset 
)

Reads a 2-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read3()

int fm.liveswitch.DataBuffer.read3 ( int  offset,
int  bitOffset 
)

Reads a 3-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read32() [1/2]

long fm.liveswitch.DataBuffer.read32 ( int  offset)

Reads a 32-bit value.

Parameters
offsetThe offset.

◆ read32() [2/2]

long fm.liveswitch.DataBuffer.read32 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 32-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read32Signed() [1/2]

long fm.liveswitch.DataBuffer.read32Signed ( int  offset)

Reads a 32-bit signed value.

Parameters
offsetThe offset.

◆ read32Signed() [2/2]

long fm.liveswitch.DataBuffer.read32Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 32-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read3Signed()

int fm.liveswitch.DataBuffer.read3Signed ( int  offset,
int  bitOffset 
)

Reads a 3-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read4()

int fm.liveswitch.DataBuffer.read4 ( int  offset,
int  bitOffset 
)

Reads a 4-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read40() [1/2]

long fm.liveswitch.DataBuffer.read40 ( int  offset)

Reads a 40-bit value.

Parameters
offsetThe offset.

◆ read40() [2/2]

long fm.liveswitch.DataBuffer.read40 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 40-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read40Signed() [1/2]

long fm.liveswitch.DataBuffer.read40Signed ( int  offset)

Reads a 40-bit signed value.

Parameters
offsetThe offset.

◆ read40Signed() [2/2]

long fm.liveswitch.DataBuffer.read40Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 40-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read48() [1/2]

long fm.liveswitch.DataBuffer.read48 ( int  offset)

Reads a 48-bit value.

Parameters
offsetThe offset.

◆ read48() [2/2]

long fm.liveswitch.DataBuffer.read48 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 48-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read48Signed() [1/2]

long fm.liveswitch.DataBuffer.read48Signed ( int  offset)

Reads a 48-bit signed value.

Parameters
offsetThe offset.

◆ read48Signed() [2/2]

long fm.liveswitch.DataBuffer.read48Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 48-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read4Signed()

int fm.liveswitch.DataBuffer.read4Signed ( int  offset,
int  bitOffset 
)

Reads a 4-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read5()

int fm.liveswitch.DataBuffer.read5 ( int  offset,
int  bitOffset 
)

Reads a 5-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read56() [1/2]

long fm.liveswitch.DataBuffer.read56 ( int  offset)

Reads a 56-bit value.

Parameters
offsetThe offset.

◆ read56() [2/2]

long fm.liveswitch.DataBuffer.read56 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 56-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read56Signed() [1/2]

long fm.liveswitch.DataBuffer.read56Signed ( int  offset)

Reads a 56-bit signed value.

Parameters
offsetThe offset.

◆ read56Signed() [2/2]

long fm.liveswitch.DataBuffer.read56Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 56-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read5Signed()

int fm.liveswitch.DataBuffer.read5Signed ( int  offset,
int  bitOffset 
)

Reads a 5-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read6()

int fm.liveswitch.DataBuffer.read6 ( int  offset,
int  bitOffset 
)

Reads a 6-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read64() [1/2]

long fm.liveswitch.DataBuffer.read64 ( int  offset)

Reads a 64-bit value.

Parameters
offsetThe offset.

◆ read64() [2/2]

long fm.liveswitch.DataBuffer.read64 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 64-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read64Signed() [1/2]

long fm.liveswitch.DataBuffer.read64Signed ( int  offset)

Reads a 64-bit signed value.

Parameters
offsetThe offset.

◆ read64Signed() [2/2]

long fm.liveswitch.DataBuffer.read64Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads a 64-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read6Signed()

int fm.liveswitch.DataBuffer.read6Signed ( int  offset,
int  bitOffset 
)

Reads a 6-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read7()

int fm.liveswitch.DataBuffer.read7 ( int  offset,
int  bitOffset 
)

Reads a 7-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read7Signed()

int fm.liveswitch.DataBuffer.read7Signed ( int  offset,
int  bitOffset 
)

Reads a 7-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ read8() [1/2]

int fm.liveswitch.DataBuffer.read8 ( int  offset)

Reads an 8-bit value.

Parameters
offsetThe offset.

◆ read8() [2/2]

int fm.liveswitch.DataBuffer.read8 ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads an 8-bit value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read8Signed() [1/2]

int fm.liveswitch.DataBuffer.read8Signed ( int  offset)

Reads an 8-bit signed value.

Parameters
offsetThe offset.

◆ read8Signed() [2/2]

int fm.liveswitch.DataBuffer.read8Signed ( int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Reads an 8-bit signed value.

Parameters
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ read9()

int fm.liveswitch.DataBuffer.read9 ( int  offset,
int  bitOffset 
)

Reads a 9-bit value.

Parameters
offsetThe offset.
bitOffsetThe bitoffset.

◆ read9Signed()

int fm.liveswitch.DataBuffer.read9Signed ( int  offset,
int  bitOffset 
)

Reads a 9-bit signed value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.

◆ readUtf8String() [1/2]

String fm.liveswitch.DataBuffer.readUtf8String ( int  offset)

Read a UTF-8 string.

Parameters
offsetThe offset.

◆ readUtf8String() [2/2]

String fm.liveswitch.DataBuffer.readUtf8String ( int  offset,
int  length 
)

Reads a UTF-8 string.

Parameters
offsetThe offset.
lengthThe length.

◆ resize() [1/3]

void fm.liveswitch.DataBuffer.resize ( int  newLength)

Resizes this buffer to a new length with new data being inserted at the end.

Parameters
newLengthThe new length.

◆ resize() [2/3]

void fm.liveswitch.DataBuffer.resize ( int  newLength,
int  offset 
)

Resizes this buffer to a new length with new data being inserted at a given offset.

Parameters
newLengthThe new length.
offsetThe offset.

◆ resize() [3/3]

void fm.liveswitch.DataBuffer.resize ( int  newLength,
int  offset,
boolean  setZero 
)

Resizes this buffer to a new length with new data being inserted at a given offset.

Parameters
newLengthThe new length.
offsetThe offset.
setZeroSets empty space to zero.

◆ sequenceEquals()

boolean fm.liveswitch.DataBuffer.sequenceEquals ( fm.liveswitch.DataBuffer  buffer)

Compares a data buffer for equality.

Parameters
bufferThe data buffer.
Returns
true
if the sequences are equal; otherwise,
false
.

◆ sequenceEqualsConstantTime()

boolean fm.liveswitch.DataBuffer.sequenceEqualsConstantTime ( fm.liveswitch.DataBuffer  buffer)

Compares a data buffer for equality in constant time.

Parameters
bufferThe buffer.
Returns
true
if the sequences are equal; otherwise,
false
.

◆ set() [1/3]

void fm.liveswitch.DataBuffer.set ( byte  value)

Sets the data buffer to the specified value.

Parameters
valueThe value.

◆ set() [2/3]

void fm.liveswitch.DataBuffer.set ( byte  value,
int  offset 
)

Sets a subset of the data buffer to the specified value.

Parameters
valueThe value.
offsetThe offset.

◆ set() [3/3]

void fm.liveswitch.DataBuffer.set ( byte  value,
int  offset,
int  length 
)

Sets a subset of the data buffer to the specified value.

Parameters
valueThe value.
offsetThe offset.
lengthThe length.

◆ setIndex()

void fm.liveswitch.DataBuffer.setIndex ( int  value)
protected

Sets the index.

◆ setInnerData()

void fm.liveswitch.DataBuffer.setInnerData ( byte[]  value)
protected

Sets backing data buffer.

◆ setLength()

void fm.liveswitch.DataBuffer.setLength ( int  value)
protected

Sets the length.

◆ setLittleEndian()

void fm.liveswitch.DataBuffer.setLittleEndian ( boolean  value)

Sets whether fm.liveswitch.DataBuffer#getData is little-endian.

◆ subset() [1/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.subset ( int  offset)

Gets a subset of this instance.

Parameters
offsetThe offset.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ subset() [2/2]

fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.subset ( int  offset,
int  length 
)

Gets a subset of this instance.

Parameters
offsetThe offset.
lengthThe length.

Reimplemented in fm.liveswitch.DataBufferSubset.

◆ toArray()

byte [] fm.liveswitch.DataBuffer.toArray ( )

Converts this instance to an array of bytes.

◆ toBytes()

byte [] fm.liveswitch.DataBuffer.toBytes ( )

Converts this instance to an array of bytes.

◆ toHexString()

String fm.liveswitch.DataBuffer.toHexString ( )

Converts this instance to a hexadecimal string.

◆ toJson() [1/2]

String fm.liveswitch.DataBuffer.toJson ( )

Serializes this instance to JSON.

◆ toJson() [2/2]

static String fm.liveswitch.DataBuffer.toJson ( final fm.liveswitch.DataBuffer  dataBuffer)
static

Serializes an instance to JSON.

Parameters
dataBufferThe data buffer.

◆ toJsonArray()

static String fm.liveswitch.DataBuffer.toJsonArray ( fm.liveswitch.DataBuffer[]  dataBuffers)
static

Serializes an array of instances to JSON.

Parameters
dataBuffersThe data buffers.

◆ tryKeep()

boolean fm.liveswitch.DataBuffer.tryKeep ( )

Attempts to increment the retain count by one.

Returns
True if successful.

◆ tryRead1()

boolean fm.liveswitch.DataBuffer.tryRead1 ( int  offset,
int  bitOffset,
fm.liveswitch.BooleanHolder  value 
)

Tries to read a 1-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueif set to
true
[value].

◆ tryRead10()

boolean fm.liveswitch.DataBuffer.tryRead10 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 10-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead11()

boolean fm.liveswitch.DataBuffer.tryRead11 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read an 11-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead12()

boolean fm.liveswitch.DataBuffer.tryRead12 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 12-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead13()

boolean fm.liveswitch.DataBuffer.tryRead13 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 13-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead14()

boolean fm.liveswitch.DataBuffer.tryRead14 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 14-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead15()

boolean fm.liveswitch.DataBuffer.tryRead15 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 15-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead16()

boolean fm.liveswitch.DataBuffer.tryRead16 ( int  offset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 16-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead17()

boolean fm.liveswitch.DataBuffer.tryRead17 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 17-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead18()

boolean fm.liveswitch.DataBuffer.tryRead18 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read an 18-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead19()

boolean fm.liveswitch.DataBuffer.tryRead19 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 19-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead2()

boolean fm.liveswitch.DataBuffer.tryRead2 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 2-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead20()

boolean fm.liveswitch.DataBuffer.tryRead20 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 20-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead21()

boolean fm.liveswitch.DataBuffer.tryRead21 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 21-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead22()

boolean fm.liveswitch.DataBuffer.tryRead22 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 22-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead23()

boolean fm.liveswitch.DataBuffer.tryRead23 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 23-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead24()

boolean fm.liveswitch.DataBuffer.tryRead24 ( int  offset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 24-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead3()

boolean fm.liveswitch.DataBuffer.tryRead3 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 3-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead32()

boolean fm.liveswitch.DataBuffer.tryRead32 ( int  offset,
fm.liveswitch.LongHolder  value 
)

Tries to read a 32-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead4()

boolean fm.liveswitch.DataBuffer.tryRead4 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 4-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead40()

boolean fm.liveswitch.DataBuffer.tryRead40 ( int  offset,
fm.liveswitch.LongHolder  value 
)

Tries to read a 40-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead48()

boolean fm.liveswitch.DataBuffer.tryRead48 ( int  offset,
fm.liveswitch.LongHolder  value 
)

Tries to read a 48-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead5()

boolean fm.liveswitch.DataBuffer.tryRead5 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 5-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead56()

boolean fm.liveswitch.DataBuffer.tryRead56 ( int  offset,
fm.liveswitch.LongHolder  value 
)

Tries to read a 56-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead6()

boolean fm.liveswitch.DataBuffer.tryRead6 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 6-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead64()

boolean fm.liveswitch.DataBuffer.tryRead64 ( int  offset,
fm.liveswitch.LongHolder  value 
)

Tries to read a 64-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead7()

boolean fm.liveswitch.DataBuffer.tryRead7 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 7-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ tryRead8()

boolean fm.liveswitch.DataBuffer.tryRead8 ( int  offset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read an 8-bit value.

Parameters
offsetThe offset.
valueThe value.

◆ tryRead9()

boolean fm.liveswitch.DataBuffer.tryRead9 ( int  offset,
int  bitOffset,
fm.liveswitch.IntegerHolder  value 
)

Tries to read a 9-bit value.

Parameters
offsetThe offset.
bitOffsetThe bit offset.
valueThe value.

◆ wrap() [1/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data)
static

Produces a new data buffer containing supplied data in big-endian format.

Parameters
dataThe data.

◆ wrap() [2/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data,
boolean  littleEndian 
)
static

Produces a new data buffer containing supplied data.

Parameters
dataThe data.
littleEndianWhether the data is little-endian.

◆ wrap() [3/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data,
int  index 
)
static

Produces a new data buffer containing supplied data in big-endian format.

Parameters
dataThe data.
indexThe index.

◆ wrap() [4/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data,
int  index,
boolean  littleEndian 
)
static

Produces a new data buffer containing supplied data.

Parameters
dataThe data.
indexThe index.
littleEndianWhether the data is little-endian.

◆ wrap() [5/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data,
int  index,
int  length 
)
static

Produces a new data buffer containing supplied data in big-endian format.

Parameters
dataThe data.
indexThe index.
lengthThe length.

◆ wrap() [6/6]

static fm.liveswitch.DataBuffer fm.liveswitch.DataBuffer.wrap ( byte[]  data,
int  index,
int  length,
boolean  littleEndian 
)
static

Produces a new data buffer containing supplied data.

Parameters
dataThe data.
indexThe index.
lengthThe length.
littleEndianWhether the data is little-endian.

◆ write() [1/3]

void fm.liveswitch.DataBuffer.write ( fm.liveswitch.DataBuffer  buffer)

Writes a data buffer to this instance.

Parameters
bufferThe buffer.

◆ write() [2/3]

void fm.liveswitch.DataBuffer.write ( fm.liveswitch.DataBuffer  buffer,
int  offset 
)

Writes a data buffer to this instance.

Parameters
bufferThe buffer.
offsetThe offset.

◆ write() [3/3]

void fm.liveswitch.DataBuffer.write ( fm.liveswitch.DataBuffer  buffer,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a data buffer to this instance.

Parameters
bufferThe buffer.
offsetThe offset.
offsetPlusThe offset plus the buffer length.

◆ write1()

boolean fm.liveswitch.DataBuffer.write1 ( boolean  value,
int  offset,
int  bitOffset 
)

Writes a 1-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write10()

boolean fm.liveswitch.DataBuffer.write10 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 10-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write11()

boolean fm.liveswitch.DataBuffer.write11 ( int  value,
int  offset,
int  bitOffset 
)

Writes an 11-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write12()

boolean fm.liveswitch.DataBuffer.write12 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 12-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write13()

boolean fm.liveswitch.DataBuffer.write13 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 13-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write14()

boolean fm.liveswitch.DataBuffer.write14 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 14-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write15()

boolean fm.liveswitch.DataBuffer.write15 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 15-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write16() [1/2]

boolean fm.liveswitch.DataBuffer.write16 ( int  value,
int  offset 
)

Writes a 16-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write16() [2/2]

boolean fm.liveswitch.DataBuffer.write16 ( int  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 16-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write16Signed()

boolean fm.liveswitch.DataBuffer.write16Signed ( int  value,
int  offset 
)

Writes a signed 16-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write17()

boolean fm.liveswitch.DataBuffer.write17 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 17-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write18()

boolean fm.liveswitch.DataBuffer.write18 ( int  value,
int  offset,
int  bitOffset 
)

Writes an 18-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write19()

boolean fm.liveswitch.DataBuffer.write19 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 19-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write2()

boolean fm.liveswitch.DataBuffer.write2 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 2-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write20()

boolean fm.liveswitch.DataBuffer.write20 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 20-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write21()

boolean fm.liveswitch.DataBuffer.write21 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 21-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write22()

boolean fm.liveswitch.DataBuffer.write22 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 22-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write23()

boolean fm.liveswitch.DataBuffer.write23 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 23-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write24() [1/2]

boolean fm.liveswitch.DataBuffer.write24 ( int  value,
int  offset 
)

Writes a 24-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write24() [2/2]

boolean fm.liveswitch.DataBuffer.write24 ( int  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 24-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write3()

boolean fm.liveswitch.DataBuffer.write3 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 3-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write32() [1/2]

boolean fm.liveswitch.DataBuffer.write32 ( long  value,
int  offset 
)

Writes a 32-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write32() [2/2]

boolean fm.liveswitch.DataBuffer.write32 ( long  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 32-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write4()

boolean fm.liveswitch.DataBuffer.write4 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 4-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write40() [1/2]

boolean fm.liveswitch.DataBuffer.write40 ( long  value,
int  offset 
)

Writes a 40-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write40() [2/2]

boolean fm.liveswitch.DataBuffer.write40 ( long  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 40-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write48() [1/2]

boolean fm.liveswitch.DataBuffer.write48 ( long  value,
int  offset 
)

Writes a 48-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write48() [2/2]

boolean fm.liveswitch.DataBuffer.write48 ( long  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 48-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write5()

boolean fm.liveswitch.DataBuffer.write5 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 5-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write56() [1/2]

boolean fm.liveswitch.DataBuffer.write56 ( long  value,
int  offset 
)

Writes a 56-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write56() [2/2]

boolean fm.liveswitch.DataBuffer.write56 ( long  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 56-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write6()

boolean fm.liveswitch.DataBuffer.write6 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 6-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write64() [1/2]

boolean fm.liveswitch.DataBuffer.write64 ( long  value,
int  offset 
)

Writes a 64-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write64() [2/2]

boolean fm.liveswitch.DataBuffer.write64 ( long  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a 64-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write7()

boolean fm.liveswitch.DataBuffer.write7 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 7-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ write8() [1/2]

boolean fm.liveswitch.DataBuffer.write8 ( int  value,
int  offset 
)

Writes an 8-bit value.

Parameters
valueThe value.
offsetThe offset.

◆ write8() [2/2]

boolean fm.liveswitch.DataBuffer.write8 ( int  value,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes an 8-bit value.

Parameters
valueThe value.
offsetThe offset.
offsetPlusThe offset plus the value length.

◆ write9()

boolean fm.liveswitch.DataBuffer.write9 ( int  value,
int  offset,
int  bitOffset 
)

Writes a 9-bit value.

Parameters
valueThe value.
offsetThe offset.
bitOffsetThe bit offset.

◆ writeBytes() [1/5]

void fm.liveswitch.DataBuffer.writeBytes ( byte[]  bytes)

Writes a byte array to this instance.

Parameters
bytesThe bytes.

◆ writeBytes() [2/5]

void fm.liveswitch.DataBuffer.writeBytes ( byte[]  bytes,
int  bytesIndex,
int  bytesLength,
int  offset 
)

Writes a byte array to this instance.

Parameters
bytesThe bytes.
bytesIndexThe bytes index.
bytesLengthThe bytes length.
offsetThe offset.

◆ writeBytes() [3/5]

void fm.liveswitch.DataBuffer.writeBytes ( byte[]  bytes,
int  bytesIndex,
int  bytesLength,
int  offset,
fm.liveswitch.IntegerHolder  offsetPlus 
)

Writes a byte array to this instance.

Parameters
bytesThe bytes.
bytesIndexThe bytes index.
bytesLengthThe bytes length.
offsetThe offset.
offsetPlusThe offset plus the buffer length.

◆ writeBytes() [4/5]

void fm.liveswitch.DataBuffer.writeBytes ( byte[]  bytes,
int  bytesIndex,
int  offset 
)

Writes a byte array to this instance.

Parameters
bytesThe bytes.
bytesIndexThe bytes index.
offsetThe offset.

◆ writeBytes() [5/5]

void fm.liveswitch.DataBuffer.writeBytes ( byte[]  bytes,
int  offset 
)

Writes a byte array to this instance.

Parameters
bytesThe bytes.
offsetThe offset.

◆ xor()

boolean fm.liveswitch.DataBuffer.xor ( int  value,
int  offset 
)

Performs a bitwise "xor" operation on a value.

Parameters
valueThe value.
offsetThe offset.