java.lang.Object
org.firebirdsql.gds.ng.DefaultDatatypeCoder
org.firebirdsql.gds.ng.jna.LittleEndianDatatypeCoder
- All Implemented Interfaces:
org.firebirdsql.gds.ng.DatatypeCoder
public final class LittleEndianDatatypeCoder
extends org.firebirdsql.gds.ng.DefaultDatatypeCoder
Datatype encoder and decoder for little endian platforms, specifically for use with the Firebird client library.
For wire protocol use DefaultDatatypeCoder.
- Since:
- 3
- Author:
- Mark Rotteveel
-
Field Summary
Fields inherited from interface org.firebirdsql.gds.ng.DatatypeCoder
FRACTIONS_PER_HOUR, FRACTIONS_PER_MILLISECOND, FRACTIONS_PER_MINUTE, FRACTIONS_PER_SECOND, NANOSECONDS_PER_FRACTION -
Constructor Summary
ConstructorsConstructorDescriptionLittleEndianDatatypeCoder(org.firebirdsql.encodings.IEncodingFactory encodingFactory) Creates a little-endian datatype coder for native access on little-endian platforms. -
Method Summary
Modifier and TypeMethodDescriptionintdecodeInt(byte[] buf, int off) longdecodeLong(byte[] buf) shortdecodeShort(byte[] buf, int off) voidencodeInt(int val, byte[] buf, int off) byte[]encodeLong(long val) voidencodeShort(int val, byte[] buf, int off) static LittleEndianDatatypeCoderforEncodingFactory(org.firebirdsql.encodings.IEncodingFactory encodingFactory) Returns an instance ofLittleEndianDatatypeCoderfor an encoding factory.protected byte[]networkOrder(byte[] buf) intMethods inherited from class org.firebirdsql.gds.ng.DefaultDatatypeCoder
createReader, createWriter, decodeBoolean, decodeDecimal128, decodeDecimal64, decodeDouble, decodeFloat, decodeInt, decodeInt128, decodeLocalDate, decodeLocalDate, decodeLocalDateTime, decodeLocalDateTime, decodeLocalTime, decodeLocalTime, decodeShort, decodeString, encodeBoolean, encodeDecimal128, encodeDecimal64, encodeDouble, encodeFloat, encodeInt, encodeInt128, encodeLocalDate, encodeLocalDate, encodeLocalDateTime, encodeLocalDateTime, encodeLocalTime, encodeLocalTime, encodeShort, encodeShort, encodeString, equals, forEncodingDefinition, getEncoding, getEncodingDefinition, getEncodingFactory, hashCode, unwrap
-
Constructor Details
-
LittleEndianDatatypeCoder
public LittleEndianDatatypeCoder(org.firebirdsql.encodings.IEncodingFactory encodingFactory) Creates a little-endian datatype coder for native access on little-endian platforms.In almost all cases, it is better to use
forEncodingFactory(IEncodingFactory).- Parameters:
encodingFactory- encoding factory
-
-
Method Details
-
forEncodingFactory
public static LittleEndianDatatypeCoder forEncodingFactory(org.firebirdsql.encodings.IEncodingFactory encodingFactory) Returns an instance ofLittleEndianDatatypeCoderfor an encoding factory.- Parameters:
encodingFactory- encoding factory- Returns:
- datatype coder, this might be a cached instance
-
sizeOfShort
public int sizeOfShort()- Specified by:
sizeOfShortin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
sizeOfShortin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
encodeShort
public void encodeShort(int val, byte[] buf, int off) - Specified by:
encodeShortin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
encodeShortin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
decodeShort
public short decodeShort(byte[] buf, int off) - Specified by:
decodeShortin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
decodeShortin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
encodeInt
public void encodeInt(int val, byte[] buf, int off) - Specified by:
encodeIntin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
encodeIntin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
decodeInt
public int decodeInt(byte[] buf, int off) - Specified by:
decodeIntin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
decodeIntin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
encodeLong
public byte[] encodeLong(long val) - Specified by:
encodeLongin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
encodeLongin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
decodeLong
public long decodeLong(byte[] buf) - Specified by:
decodeLongin interfaceorg.firebirdsql.gds.ng.DatatypeCoder- Overrides:
decodeLongin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-
networkOrder
protected byte[] networkOrder(byte[] buf) - Overrides:
networkOrderin classorg.firebirdsql.gds.ng.DefaultDatatypeCoder
-