public final class BigEndianDatatypeCoder extends DefaultDatatypeCoder
For wire protocol use DefaultDatatypeCoder
.
DatatypeCoder.RawDateTimeStruct
FRACTIONS_PER_HOUR, FRACTIONS_PER_MILLISECOND, FRACTIONS_PER_MINUTE, FRACTIONS_PER_SECOND, NANOSECONDS_PER_FRACTION
Constructor and Description |
---|
BigEndianDatatypeCoder(IEncodingFactory encodingFactory)
Creates a big-endian datatype coder for native access on big-endian platforms.
|
Modifier and Type | Method and Description |
---|---|
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. |
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 BigEndianDatatypeCoder |
forEncodingFactory(IEncodingFactory encodingFactory)
Returns an instance of
BigEndianDatatypeCoder for an encoding factory. |
int |
sizeOfShort()
The size of an encoded short in this data type coder.
|
createReader, createWriter, decodeBoolean, decodeDate, decodeDate, decodeDateCalendar, decodeDateRaw, decodeDecimal128, decodeDecimal64, decodeDouble, decodeFloat, decodeInt, decodeInt, decodeInt128, decodeLong, decodeString, decodeTime, decodeTime, decodeTimeCalendar, decodeTimeRaw, decodeTimestamp, decodeTimestamp, decodeTimestamp, decodeTimestampCalendar, decodeTimestampRaw, encodeBoolean, encodeDate, encodeDate, encodeDateCalendar, encodeDateRaw, encodeDecimal128, encodeDecimal64, encodeDouble, encodeFloat, encodeInt, encodeInt, encodeInt128, encodeLocalDate, encodeLocalDateTime, encodeLocalTime, encodeLong, encodeShort, encodeString, encodeTime, encodeTime, encodeTimeCalendar, encodeTimeRaw, encodeTimestamp, encodeTimestamp, encodeTimestamp, encodeTimestampCalendar, encodeTimestampRaw, equals, forEncodingDefinition, getEncoding, getEncodingDefinition, getEncodingFactory, hashCode, intToBytes, unwrap
public BigEndianDatatypeCoder(IEncodingFactory encodingFactory)
In almost all cases, it is better to use forEncodingFactory(IEncodingFactory)
.
encodingFactory
- Encoding factorypublic static BigEndianDatatypeCoder forEncodingFactory(IEncodingFactory encodingFactory)
BigEndianDatatypeCoder
for an encoding factory.encodingFactory
- Encoding factorypublic int sizeOfShort()
DatatypeCoder
sizeOfShort
in interface DatatypeCoder
sizeOfShort
in class DefaultDatatypeCoder
2
or 4
bytes)public byte[] encodeShort(short value)
DatatypeCoder
short
value as a byte
array.encodeShort
in interface DatatypeCoder
encodeShort
in class DefaultDatatypeCoder
value
- The value to be encodedvalue
encoded as a byte
arrayDatatypeCoder.encodeShort(int)
public void encodeShort(int value, byte[] target, int fromIndex)
DatatypeCoder
short
value into the target
byte array starting at index fromIndex
.encodeShort
in interface DatatypeCoder
encodeShort
in class DefaultDatatypeCoder
value
- 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)
DatatypeCoder
byte
array into a short
value.decodeShort
in interface DatatypeCoder
decodeShort
in class DefaultDatatypeCoder
byte_int
- The byte
array to be decodedshort
value of the decoded byte
arraypublic short decodeShort(byte[] bytes, int fromIndex)
DatatypeCoder
byte
array to a short
value.decodeShort
in interface DatatypeCoder
decodeShort
in class DefaultDatatypeCoder
bytes
- The byte
array to be decodedfromIndex
- The index to start readingshort
value of the decoded byte
arrayCopyright © 2001-2023 Jaybird (Firebird JDBC/JCA) team. All rights reserved.