Package org.firebirdsql.gds.ng.jna
Class BigEndianDatatypeCoder
- java.lang.Object
- 
- org.firebirdsql.gds.ng.DefaultDatatypeCoder
- 
- org.firebirdsql.gds.ng.jna.BigEndianDatatypeCoder
 
 
- 
- All Implemented Interfaces:
- DatatypeCoder
 
 public final class BigEndianDatatypeCoder extends DefaultDatatypeCoder Datatype encoder and decoder for big endian platforms, specifically for use with the Firebird client library.For wire protocol use DefaultDatatypeCoder.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.DatatypeCoderDatatypeCoder.RawDateTimeStruct
 
- 
 - 
Field Summary- 
Fields inherited from interface org.firebirdsql.gds.ng.DatatypeCoderFRACTIONS_PER_HOUR, FRACTIONS_PER_MILLISECOND, FRACTIONS_PER_MINUTE, FRACTIONS_PER_SECOND, NANOSECONDS_PER_FRACTION
 
- 
 - 
Constructor SummaryConstructors Constructor Description BigEndianDatatypeCoder(IEncodingFactory encodingFactory)Creates a big-endian datatype coder for native access on big-endian platforms.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description shortdecodeShort(byte[] byte_int)Decode abytearray into ashortvalue.shortdecodeShort(byte[] bytes, int fromIndex)Decode from abytearray to ashortvalue.voidencodeShort(int value, byte[] target, int fromIndex)Encode ashortvalue into thetargetbyte array starting at indexfromIndex.byte[]encodeShort(short value)Encode ashortvalue as abytearray.static BigEndianDatatypeCoderforEncodingFactory(IEncodingFactory encodingFactory)Returns an instance ofBigEndianDatatypeCoderfor an encoding factory.intsizeOfShort()The size of an encoded short in this data type coder.- 
Methods inherited from class org.firebirdsql.gds.ng.DefaultDatatypeCodercreateReader, createWriter, decodeBoolean, decodeDate, decodeDateCalendar, decodeDateRaw, decodeDecimal128, decodeDecimal64, decodeDouble, decodeFloat, decodeInt, decodeInt, decodeInt128, decodeLocalDate, decodeLocalDateTime, decodeLocalTime, decodeLong, decodeString, decodeTime, decodeTimeCalendar, decodeTimeRaw, decodeTimestamp, decodeTimestampCalendar, decodeTimestampRaw, encodeBoolean, encodeDate, encodeDateCalendar, encodeDateRaw, encodeDecimal128, encodeDecimal64, encodeDouble, encodeFloat, encodeInt, encodeInt, encodeInt128, encodeLocalDate, encodeLocalDateTime, encodeLocalTime, encodeLong, encodeShort, encodeString, encodeTime, encodeTimeCalendar, encodeTimeRaw, encodeTimestamp, encodeTimestampCalendar, encodeTimestampRaw, equals, forEncodingDefinition, getEncoding, getEncodingDefinition, getEncodingFactory, hashCode, intToBytes, unwrap
 
- 
 
- 
- 
- 
Constructor Detail- 
BigEndianDatatypeCoderpublic BigEndianDatatypeCoder(IEncodingFactory encodingFactory) Creates a big-endian datatype coder for native access on big-endian platforms.In almost all cases, it is better to use forEncodingFactory(IEncodingFactory).- Parameters:
- encodingFactory- Encoding factory
 
 
- 
 - 
Method Detail- 
forEncodingFactorypublic static BigEndianDatatypeCoder forEncodingFactory(IEncodingFactory encodingFactory) Returns an instance ofBigEndianDatatypeCoderfor an encoding factory.- Parameters:
- encodingFactory- Encoding factory
- Returns:
- Datatype coder, this might be a cached instance
 
 - 
sizeOfShortpublic int sizeOfShort() Description copied from interface:DatatypeCoderThe size of an encoded short in this data type coder.- Specified by:
- sizeOfShortin interface- DatatypeCoder
- Overrides:
- sizeOfShortin class- DefaultDatatypeCoder
- Returns:
- The size of an encoded short (either 2or4bytes)
 
 - 
encodeShortpublic byte[] encodeShort(short value) Description copied from interface:DatatypeCoderEncode ashortvalue as abytearray.- Specified by:
- encodeShortin interface- DatatypeCoder
- Overrides:
- encodeShortin class- DefaultDatatypeCoder
- Parameters:
- value- The value to be encoded
- Returns:
- The value of valueencoded as abytearray
- See Also:
- DatatypeCoder.encodeShort(int)
 
 - 
encodeShortpublic void encodeShort(int value, byte[] target, int fromIndex)Description copied from interface:DatatypeCoderEncode ashortvalue into thetargetbyte array starting at indexfromIndex.- Specified by:
- encodeShortin interface- DatatypeCoder
- Overrides:
- encodeShortin class- DefaultDatatypeCoder
- Parameters:
- value- The value to be encoded
- target- Target byte array of sufficient size (warning: this may be datatype coder specific)
- fromIndex- Index to start writing
 
 - 
decodeShortpublic short decodeShort(byte[] byte_int) Description copied from interface:DatatypeCoderDecode abytearray into ashortvalue.- Specified by:
- decodeShortin interface- DatatypeCoder
- Overrides:
- decodeShortin class- DefaultDatatypeCoder
- Parameters:
- byte_int- The- bytearray to be decoded
- Returns:
- The shortvalue of the decodedbytearray
 
 - 
decodeShortpublic short decodeShort(byte[] bytes, int fromIndex)Description copied from interface:DatatypeCoderDecode from abytearray to ashortvalue.- Specified by:
- decodeShortin interface- DatatypeCoder
- Overrides:
- decodeShortin class- DefaultDatatypeCoder
- Parameters:
- bytes- The- bytearray to be decoded
- fromIndex- The index to start reading
- Returns:
- The shortvalue of the decodedbytearray
 
 
- 
 
-