Package org.mariadb.jdbc.plugin.codec
Class LongCodec
- java.lang.Object
-
- org.mariadb.jdbc.plugin.codec.LongCodec
-
-
Constructor Summary
Constructors Constructor Description LongCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDecode(org.mariadb.jdbc.client.Column column, Class<?> type)If codec can decode this a server datatype to a java class typebooleancanEncode(Object value)Can Codec encode the java object typeStringclassName()Codec native typeLongdecodeBinary(org.mariadb.jdbc.client.ReadableByteBuf buffer, int length, org.mariadb.jdbc.client.Column column, Calendar cal)Decode from a mysql packet binary encoded a value to codec java typelongdecodeBinaryLong(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column)Decode long from binary row.LongdecodeText(org.mariadb.jdbc.client.ReadableByteBuf buffer, int length, org.mariadb.jdbc.client.Column column, Calendar cal)Decode from a mysql packet text encoded a value to codec java typelongdecodeTextLong(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column)Decode long from text row.voidencodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength)Binary encode value to writervoidencodeText(Writer encoder, org.mariadb.jdbc.client.Context context, Object value, Calendar cal, Long maxLen)Text encode value to writerintgetBinaryEncodeType()Return server encoding data type-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.plugin.Codec
canEncodeLongData, encodeData, encodeLongData
-
-
-
-
Field Detail
-
INSTANCE
public static final LongCodec INSTANCE
default instance
-
-
Method Detail
-
canDecode
public boolean canDecode(org.mariadb.jdbc.client.Column column, Class<?> type)Description copied from interface:CodecIf codec can decode this a server datatype to a java class type
-
canEncode
public boolean canEncode(Object value)
Description copied from interface:CodecCan Codec encode the java object type
-
decodeText
public Long decodeText(org.mariadb.jdbc.client.ReadableByteBuf buffer, int length, org.mariadb.jdbc.client.Column column, Calendar cal) throws SQLDataException
Description copied from interface:CodecDecode from a mysql packet text encoded a value to codec java type- Specified by:
decodeTextin interfaceCodec<Long>- Parameters:
buffer- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendar- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
decodeTextLong
public long decodeTextLong(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column) throws SQLDataExceptionDecode long from text row.- Parameters:
buf- packet bufferlength- data lengthcolumn- column metadata- Returns:
- long value
- Throws:
SQLDataException- if type doesn't correspond / wrong data
-
decodeBinary
public Long decodeBinary(org.mariadb.jdbc.client.ReadableByteBuf buffer, int length, org.mariadb.jdbc.client.Column column, Calendar cal) throws SQLDataException
Description copied from interface:CodecDecode from a mysql packet binary encoded a value to codec java type- Specified by:
decodeBinaryin interfaceCodec<Long>- Parameters:
buffer- mysql packet bufferlength- encoded value lengthcolumn- server column metadatacal- calendar- Returns:
- decoded value
- Throws:
SQLDataException- if unexpected error occurs during decoding
-
decodeBinaryLong
public long decodeBinaryLong(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, org.mariadb.jdbc.client.Column column) throws SQLDataExceptionDecode long from binary row.- Parameters:
buf- packet bufferlength- data lengthcolumn- column metadata- Returns:
- long value
- Throws:
SQLDataException- if type doesn't correspond / wrong data
-
encodeText
public void encodeText(Writer encoder, org.mariadb.jdbc.client.Context context, Object value, Calendar cal, Long maxLen) throws IOException
Description copied from interface:CodecText encode value to writer- Specified by:
encodeTextin interfaceCodec<Long>- Parameters:
encoder- writercontext- connection contextvalue- value to encodecal- calendarmaxLen- maximum value length- Throws:
IOException- if any socket error occurs
-
encodeBinary
public void encodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength) throws IOException
Description copied from interface:CodecBinary encode value to writer- Specified by:
encodeBinaryin interfaceCodec<Long>- Parameters:
encoder- writervalue- value to encodecal- calendarmaxLength- maximum value length- Throws:
IOException- if any socket error occurs
-
getBinaryEncodeType
public int getBinaryEncodeType()
Description copied from interface:CodecReturn server encoding data type- Specified by:
getBinaryEncodeTypein interfaceCodec<Long>- Returns:
- server encoding data type
-
-