| Modifier and Type | Field and Description |
|---|---|
static byte[] |
BINARY_PREFIX |
static ByteArrayCodec |
INSTANCE |
| Constructor and Description |
|---|
ByteArrayCodec() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode(com.singlestore.jdbc.client.ColumnDecoder column,
Class<?> type)
If codec can decode this a server datatype to a java class type
|
boolean |
canEncode(Object value)
Can Codec encode the java object type
|
String |
className()
Codec native type
|
byte[] |
decodeBinary(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
Decode from a mysql packet binary encoded a value to codec java type
|
byte[] |
decodeText(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
Decode from a mysql packet text encoded a value to codec java type
|
void |
encodeBinary(Writer encoder,
Object value,
Calendar cal,
Long maxLength)
Binary encode value to writer
|
void |
encodeText(Writer encoder,
com.singlestore.jdbc.client.Context context,
Object value,
Calendar cal,
Long maxLength)
Text encode value to writer
|
int |
getApproximateTextProtocolLength(Object value)
Approximate length in bytes.
|
int |
getBinaryEncodeType()
Return server encoding data type
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanEncodeLongData, encodeBinaryAsString, encodeData, encodeLongDatapublic static final byte[] BINARY_PREFIX
public static final ByteArrayCodec INSTANCE
public boolean canDecode(com.singlestore.jdbc.client.ColumnDecoder column,
Class<?> type)
Codecpublic boolean canEncode(Object value)
Codecpublic int getApproximateTextProtocolLength(Object value) throws SQLException
CodecgetApproximateTextProtocolLength in interface Codec<byte[]>value - to calculateSQLExceptionpublic byte[] decodeText(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
throws SQLDataException
CodecdecodeText in interface Codec<byte[]>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic byte[] decodeBinary(com.singlestore.jdbc.client.ReadableByteBuf buf,
MutableInt length,
com.singlestore.jdbc.client.ColumnDecoder column,
Calendar cal)
throws SQLDataException
CodecdecodeBinary in interface Codec<byte[]>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic void encodeText(Writer encoder, com.singlestore.jdbc.client.Context context, Object value, Calendar cal, Long maxLength) throws IOException
CodecencodeText in interface Codec<byte[]>encoder - writercontext - connection contextvalue - value to encodecal - calendarmaxLength - maximum value lengthIOException - if any socket error occurspublic void encodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength) throws IOException
CodecencodeBinary in interface Codec<byte[]>encoder - writervalue - value to encodecal - calendarmaxLength - maximum value lengthIOException - if any socket error occurspublic int getBinaryEncodeType()
CodecgetBinaryEncodeType in interface Codec<byte[]>Copyright © 2025 SingleStore. All rights reserved.