Class BinaryRowDecoder
java.lang.Object
org.mariadb.jdbc.client.result.rowdecoder.BinaryRowDecoder
- All Implemented Interfaces:
RowDecoder
BINARY rows decoder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdecode(Codec<T> codec, Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) Binary decode data according to data type.booleandecodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to boolean.bytedecodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to byte.decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Date.doubledecodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to double.floatdecodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to float.intdecodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to int.longdecodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to long.shortdecodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) Decode data according to short.decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to String.decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Time.decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) Decode data according to Timestamp.defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) Decode data according to data type.intsetPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList) Set length and pos indicator to asked index.booleanwasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength) Indicate if last decoded value was null
-
Constructor Details
-
BinaryRowDecoder
public BinaryRowDecoder()
-
-
Method Details
-
decode
public <T> T decode(Codec<T> codec, Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws SQLException Binary decode data according to data type.- Specified by:
decodein interfaceRowDecoder- Type Parameters:
T- Codec default return type- Parameters:
codec- current codeccal- calendarrowBuf- row bufferfieldLength- field lengthmetadataList- metadatasfieldIndex- field indexcontext- connection context- Returns:
- default object according to metadata
- Throws:
SQLException- if any decoding error occurs
-
defaultDecode
public Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Description copied from interface:RowDecoderDecode data according to data type.- Specified by:
defaultDecodein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcontext- connection context- Returns:
- data
- Throws:
SQLException- if any decoding error occurs
-
decodeString
public String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws SQLException Description copied from interface:RowDecoderDecode data according to String.- Specified by:
decodeStringin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcontext- connection Context- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to String value
-
decodeByte
public byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to byte.- Specified by:
decodeBytein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to byte value
-
decodeBoolean
public boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to boolean.- Specified by:
decodeBooleanin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to boolean value
-
decodeDate
public Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoderDecode data according to Date.- Specified by:
decodeDatein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- current context- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to Date value
-
decodeTime
public Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoderDecode data according to Time.- Specified by:
decodeTimein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- connection context- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to Time value
-
decodeTimestamp
public Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Calendar cal, Context context) throws SQLException Description copied from interface:RowDecoderDecode data according to Timestamp.- Specified by:
decodeTimestampin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field lengthcal- calendarcontext- connection context- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to Timestamp value
-
decodeShort
public short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to short.- Specified by:
decodeShortin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to short value
-
decodeInt
public int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to int.- Specified by:
decodeIntin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to int value
-
decodeLong
public long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to long.- Specified by:
decodeLongin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to long value
-
decodeFloat
public float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to float.- Specified by:
decodeFloatin interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to float value
-
decodeDouble
public double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws SQLException Description copied from interface:RowDecoderDecode data according to double.- Specified by:
decodeDoublein interfaceRowDecoder- Parameters:
metadataList- metadata listfieldIndex- field indexrowBuf- row bufferfieldLength- field length- Returns:
- data
- Throws:
SQLException- if data type cannot be decoded to double value
-
wasNull
Description copied from interface:RowDecoderIndicate if last decoded value was null- Specified by:
wasNullin interfaceRowDecoder- Parameters:
nullBitmap- null bitmapfieldIndex- field indexfieldLength- field length- Returns:
- true if last value was null
-
setPosition
public int setPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList) Set length and pos indicator to asked index.- Specified by:
setPositionin interfaceRowDecoder- Parameters:
newIndex- index (0 is first).fieldIndex- current field indexmaxIndex- maximum indexrowBuf- row buffernullBitmap- null bitmapmetadataList- metadata list- Returns:
- new index to read data
-