Class BinaryRowDecoder
- java.lang.Object
-
- org.mariadb.jdbc.client.result.rowdecoder.BinaryRowDecoder
-
- All Implemented Interfaces:
RowDecoder
public class BinaryRowDecoder extends java.lang.Object implements RowDecoder
BINARY rows decoder
-
-
Constructor Summary
Constructors Constructor Description BinaryRowDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
decode(Codec<T> codec, java.util.Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context)
Binary decode data according to data type.boolean
decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to boolean.byte
decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to byte.java.sql.Date
decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Date.double
decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to double.float
decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to float.int
decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to int.long
decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to long.short
decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength)
Decode data according to short.java.lang.String
decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)
Decode data according to String.java.sql.Time
decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Time.java.sql.Timestamp
decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context)
Decode data according to Timestamp.java.lang.Object
defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context)
Decode data according to data type.int
setPosition(int newIndex, MutableInt fieldIndex, int maxIndex, StandardReadableByteBuf rowBuf, byte[] nullBitmap, ColumnDecoder[] metadataList)
Set length and pos indicator to asked index.boolean
wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)
Indicate if last decoded value was null
-
-
-
Method Detail
-
decode
public <T> T decode(Codec<T> codec, java.util.Calendar cal, StandardReadableByteBuf rowBuf, MutableInt fieldLength, ColumnDecoder[] metadataList, MutableInt fieldIndex, Context context) throws java.sql.SQLException
Binary decode data according to data type.- Specified by:
decode
in 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:
java.sql.SQLException
- if any decoding error occurs
-
defaultDecode
public java.lang.Object defaultDecode(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to data type.- Specified by:
defaultDecode
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if any decoding error occurs
-
decodeString
public java.lang.String decodeString(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to String.- Specified by:
decodeString
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcontext
- connection Context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to String value
-
decodeByte
public byte decodeByte(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to byte.- Specified by:
decodeByte
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to byte value
-
decodeBoolean
public boolean decodeBoolean(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to boolean.- Specified by:
decodeBoolean
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to boolean value
-
decodeDate
public java.sql.Date decodeDate(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to Date.- Specified by:
decodeDate
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- current context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Date value
-
decodeTime
public java.sql.Time decodeTime(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to Time.- Specified by:
decodeTime
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Time value
-
decodeTimestamp
public java.sql.Timestamp decodeTimestamp(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength, java.util.Calendar cal, Context context) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to Timestamp.- Specified by:
decodeTimestamp
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field lengthcal
- calendarcontext
- connection context- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to Timestamp value
-
decodeShort
public short decodeShort(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to short.- Specified by:
decodeShort
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to short value
-
decodeInt
public int decodeInt(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to int.- Specified by:
decodeInt
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to int value
-
decodeLong
public long decodeLong(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to long.- Specified by:
decodeLong
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to long value
-
decodeFloat
public float decodeFloat(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to float.- Specified by:
decodeFloat
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to float value
-
decodeDouble
public double decodeDouble(ColumnDecoder[] metadataList, MutableInt fieldIndex, StandardReadableByteBuf rowBuf, MutableInt fieldLength) throws java.sql.SQLException
Description copied from interface:RowDecoder
Decode data according to double.- Specified by:
decodeDouble
in interfaceRowDecoder
- Parameters:
metadataList
- metadata listfieldIndex
- field indexrowBuf
- row bufferfieldLength
- field length- Returns:
- data
- Throws:
java.sql.SQLException
- if data type cannot be decoded to double value
-
wasNull
public boolean wasNull(byte[] nullBitmap, MutableInt fieldIndex, MutableInt fieldLength)
Description copied from interface:RowDecoder
Indicate if last decoded value was null- Specified by:
wasNull
in 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:
setPosition
in 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
-
-