public final class LittleEndianDatatypeCoder extends DefaultDatatypeCoder
For wire protocol use DefaultDatatypeCoder.
DatatypeCoder.RawDateTimeStructFRACTIONS_PER_HOUR, FRACTIONS_PER_MILLISECOND, FRACTIONS_PER_MINUTE, FRACTIONS_PER_SECOND, NANOSECONDS_PER_FRACTION| Constructor and Description |
|---|
LittleEndianDatatypeCoder(IEncodingFactory encodingFactory)
Creates a little-endian datatype coder for native access on little-endian platforms.
|
| Modifier and Type | Method and Description |
|---|---|
Decimal128 |
decodeDecimal128(byte[] data)
Decodes a decimal128 from byte array.
|
Decimal64 |
decodeDecimal64(byte[] data)
Decodes a decimal64 from byte array.
|
int |
decodeInt(byte[] byte_int)
Decode a
byte array into an int value. |
int |
decodeInt(byte[] bytes,
int fromIndex)
Decode a
byte array to an int value. |
java.math.BigInteger |
decodeInt128(byte[] data)
Decodes a BigInteger from byte array.
|
long |
decodeLong(byte[] byte_int)
Decode a
byte array into a long value. |
short |
decodeShort(byte[] byte_int)
Decode a
byte array into a short value. |
short |
decodeShort(byte[] bytes,
int fromIndex)
Decode from a
byte array to a short value. |
byte[] |
encodeDecimal128(Decimal128 decimal128)
Encodes a decimal128 to a byte array.
|
byte[] |
encodeDecimal64(Decimal64 decimal64)
Encodes a decimal64 to a byte array.
|
byte[] |
encodeInt(int value)
Encode an
int value as a byte array. |
void |
encodeInt(int value,
byte[] target,
int fromIndex)
Encode an
int value into the target byte array starting at index fromIndex. |
byte[] |
encodeInt128(java.math.BigInteger bigInteger)
Encodes a BigInteger to a 16-byte byte array.
|
byte[] |
encodeLong(long value)
Encode a
long value as a byte array. |
void |
encodeShort(int value,
byte[] target,
int fromIndex)
Encode a
short value into the target byte array starting at index fromIndex. |
byte[] |
encodeShort(short value)
Encode a
short value as a byte array. |
static LittleEndianDatatypeCoder |
forEncodingFactory(IEncodingFactory encodingFactory)
Returns an instance of
LittleEndianDatatypeCoder for an encoding factory. |
int |
sizeOfShort()
The size of an encoded short in this data type coder.
|
createReader, createWriter, decodeBoolean, decodeDate, decodeDateCalendar, decodeDateRaw, decodeDouble, decodeFloat, decodeLocalDate, decodeLocalDateTime, decodeLocalTime, decodeString, decodeTime, decodeTimeCalendar, decodeTimeRaw, decodeTimestamp, decodeTimestampCalendar, decodeTimestampRaw, encodeBoolean, encodeDate, encodeDateCalendar, encodeDateRaw, encodeDouble, encodeFloat, encodeLocalDate, encodeLocalDateTime, encodeLocalTime, encodeShort, encodeString, encodeTime, encodeTimeCalendar, encodeTimeRaw, encodeTimestamp, encodeTimestampCalendar, encodeTimestampRaw, equals, forEncodingDefinition, getEncoding, getEncodingDefinition, getEncodingFactory, hashCode, intToBytes, unwrappublic LittleEndianDatatypeCoder(IEncodingFactory encodingFactory)
In almost all cases, it is better to use forEncodingFactory(IEncodingFactory).
encodingFactory - Encoding factorypublic static LittleEndianDatatypeCoder forEncodingFactory(IEncodingFactory encodingFactory)
LittleEndianDatatypeCoder for an encoding factory.encodingFactory - Encoding factorypublic int sizeOfShort()
DatatypeCodersizeOfShort in interface DatatypeCodersizeOfShort in class DefaultDatatypeCoder2 or 4 bytes)public byte[] encodeShort(short value)
DatatypeCodershort value as a byte array.encodeShort in interface DatatypeCoderencodeShort in class DefaultDatatypeCodervalue - The value to be encodedvalue encoded as a byte arrayDatatypeCoder.encodeShort(int)public void encodeShort(int value,
byte[] target,
int fromIndex)
DatatypeCodershort value into the target byte array starting at index fromIndex.encodeShort in interface DatatypeCoderencodeShort in class DefaultDatatypeCodervalue - The value to be encodedtarget - Target byte array of sufficient size (warning: this may be datatype coder specific)fromIndex - Index to start writingpublic short decodeShort(byte[] byte_int)
DatatypeCoderbyte array into a short value.decodeShort in interface DatatypeCoderdecodeShort in class DefaultDatatypeCoderbyte_int - The byte array to be decodedshort value of the decoded byte arraypublic short decodeShort(byte[] bytes,
int fromIndex)
DatatypeCoderbyte array to a short value.decodeShort in interface DatatypeCoderdecodeShort in class DefaultDatatypeCoderbytes - The byte array to be decodedfromIndex - The index to start readingshort value of the decoded byte arraypublic byte[] encodeInt(int value)
DatatypeCoderint value as a byte array.encodeInt in interface DatatypeCoderencodeInt in class DefaultDatatypeCodervalue - The value to be encodedvalue encoded as a byte arraypublic void encodeInt(int value,
byte[] target,
int fromIndex)
DatatypeCoderint value into the target byte array starting at index fromIndex.encodeInt in interface DatatypeCoderencodeInt in class DefaultDatatypeCodervalue - The value to be encodedtarget - Target byte array of sufficient sizefromIndex - Index to start writingpublic int decodeInt(byte[] byte_int)
DatatypeCoderbyte array into an int value.decodeInt in interface DatatypeCoderdecodeInt in class DefaultDatatypeCoderbyte_int - The byte array to be decodedint value of the decoded byte arraypublic int decodeInt(byte[] bytes,
int fromIndex)
DatatypeCoderbyte array to an int value.decodeInt in interface DatatypeCoderdecodeInt in class DefaultDatatypeCoderbytes - The byte array to be decodedfromIndex - The index to start readingint value of the decoded byte arraypublic byte[] encodeLong(long value)
DatatypeCoderlong value as a byte array.encodeLong in interface DatatypeCoderencodeLong in class DefaultDatatypeCodervalue - The value to be encodedvalue encoded as a byte arraypublic long decodeLong(byte[] byte_int)
DatatypeCoderbyte array into a long value.decodeLong in interface DatatypeCoderdecodeLong in class DefaultDatatypeCoderbyte_int - The byte array to be decodedlong value of the decoded byte arraypublic Decimal64 decodeDecimal64(byte[] data)
DatatypeCoderdecodeDecimal64 in interface DatatypeCoderdecodeDecimal64 in class DefaultDatatypeCoderdata - Data to decode (expected 8 bytes)public byte[] encodeDecimal64(Decimal64 decimal64)
DatatypeCoderencodeDecimal64 in interface DatatypeCoderencodeDecimal64 in class DefaultDatatypeCoderdecimal64 - The decimal64 value to be encodedpublic Decimal128 decodeDecimal128(byte[] data)
DatatypeCoderdecodeDecimal128 in interface DatatypeCoderdecodeDecimal128 in class DefaultDatatypeCoderdata - Data to decode (expected 16 bytes)public byte[] encodeDecimal128(Decimal128 decimal128)
DatatypeCoderencodeDecimal128 in interface DatatypeCoderencodeDecimal128 in class DefaultDatatypeCoderdecimal128 - The decimal128 value to be encodedpublic java.math.BigInteger decodeInt128(byte[] data)
DatatypeCoderdecodeInt128 in interface DatatypeCoderdecodeInt128 in class DefaultDatatypeCoderdata - Data to decode (expected 16 bytes)public byte[] encodeInt128(java.math.BigInteger bigInteger)
DatatypeCoder
The implementation expects to be passed a value that fits in 16 bytes. If a larger value is passed, and
IllegalArgumentException is thrown.
encodeInt128 in interface DatatypeCoderencodeInt128 in class DefaultDatatypeCoderbigInteger - The BigInteger value to be encodedCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.