public class TLVUtils extends Object
| Constructor | Description |
|---|---|
TLVUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static int |
appendAttribute(byte[] data,
int index,
int type,
boolean value) |
Append the boolean value using 1 byte into the given byte array at given index.
|
static int |
appendAttribute(byte[] data,
int index,
int type,
byte value) |
Append the byte value using 1 byte into the given byte array at given index.
|
static int |
appendAttribute(byte[] data,
int index,
int type,
byte[] value,
int offset,
int length) |
Append the byte array value into the given byte array at given index.
|
static int |
appendAttribute(byte[] data,
int index,
int type,
ByteArray value) |
Append the byte array value into the given byte array at given index.
|
static int |
appendAttribute(byte[] data,
int index,
int type,
double value,
int numberOfBytes) |
Append the double value using
numberOfBytes bytes into the given byte array at given index. |
static int |
appendAttribute(byte[] data,
int index,
int type,
long value,
int numberOfBytes) |
Append the long value using given number of bytes into the given byte array at given index.
|
static int |
appendAttribute(byte[] data,
int index,
int type,
String value) |
Append the String value into the given byte array at given index.
|
static void |
test() |
public static int appendAttribute(byte[] data,
int index,
int type,
boolean value)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended. If this is true, then byte value 1 will be appended, else if this
is false, byte value 0 will be appended.public static int appendAttribute(byte[] data,
int index,
int type,
byte value)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended. Byte value will be appended using 1 byte.public static int appendAttribute(byte[] data,
int index,
int type,
long value,
int numberOfBytes)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended. Long value will be appended using numberOfBytes byte
in little-endiannumberOfBytes - Defines the number of bytes required to put the value into byte array.public static int appendAttribute(byte[] data,
int index,
int type,
double value,
int numberOfBytes)
numberOfBytes bytes into the given byte array at given index.data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended. Double value will be appended using numberOfBytes byte
in little-endiannumberOfBytes - Defines the number of bytes required to put the value into byte array.public static int appendAttribute(byte[] data,
int index,
int type,
String value)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended.public static int appendAttribute(byte[] data,
int index,
int type,
byte[] value,
int offset,
int length)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended.offset - starting index of the value byte arraylength - length of value byte array to be appended into data byte arraypublic static int appendAttribute(byte[] data,
int index,
int type,
ByteArray value)
data - where value will be appended.index - starting index of the byte array where value will be addedtype - Type of TLV format.value - This value will be appended.public static void test()
Copyright © 2025. All rights reserved.