public class StreamCodec extends Object implements Codec<InputStream>
| Modifier and Type | Field and Description |
|---|---|
static StreamCodec |
INSTANCE |
| Constructor and Description |
|---|
StreamCodec() |
| 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
|
InputStream |
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
|
InputStream |
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
|
byte[] |
encodeData(InputStream value,
Long maxLength)
binary encoding value to a byte[]
|
void |
encodeLongData(Writer encoder,
InputStream value,
Long maxLength)
binary encoding value to a long data packet
|
void |
encodeText(Writer encoder,
com.singlestore.jdbc.client.Context context,
Object value,
Calendar cal,
Long maxLen)
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, encodeBinaryAsStringpublic static final StreamCodec INSTANCE
public String className()
CodecclassName in interface Codec<InputStream>public boolean canDecode(com.singlestore.jdbc.client.ColumnDecoder column,
Class<?> type)
CodeccanDecode in interface Codec<InputStream>column - server datatypetype - java return classpublic InputStream decodeText(com.singlestore.jdbc.client.ReadableByteBuf buf, MutableInt length, com.singlestore.jdbc.client.ColumnDecoder column, Calendar cal) throws SQLDataException
CodecdecodeText in interface Codec<InputStream>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic InputStream decodeBinary(com.singlestore.jdbc.client.ReadableByteBuf buf, MutableInt length, com.singlestore.jdbc.client.ColumnDecoder column, Calendar cal) throws SQLDataException
CodecdecodeBinary in interface Codec<InputStream>buf - mysql packet bufferlength - encoded value lengthcolumn - server column metadatacal - calendarSQLDataException - if unexpected error occurs during decodingpublic boolean canEncode(Object value)
CodeccanEncode in interface Codec<InputStream>value - java object typepublic int getApproximateTextProtocolLength(Object value) throws SQLException
CodecgetApproximateTextProtocolLength in interface Codec<InputStream>value - to calculateSQLExceptionpublic void encodeText(Writer encoder, com.singlestore.jdbc.client.Context context, Object value, Calendar cal, Long maxLen) throws IOException
CodecencodeText in interface Codec<InputStream>encoder - writercontext - connection contextvalue - value to encodecal - calendarmaxLen - maximum value lengthIOException - if any socket error occurspublic void encodeBinary(Writer encoder, Object value, Calendar cal, Long maxLength) throws IOException
CodecencodeBinary in interface Codec<InputStream>encoder - writervalue - value to encodecal - calendarmaxLength - maximum value lengthIOException - if any socket error occurspublic void encodeLongData(Writer encoder, InputStream value, Long maxLength) throws IOException
CodecencodeLongData in interface Codec<InputStream>encoder - writervalue - value to encodemaxLength - maximum length valueIOException - if any socket error occurspublic byte[] encodeData(InputStream value, Long maxLength) throws IOException
CodecencodeData in interface Codec<InputStream>value - value to encodemaxLength - maximum length valueIOException - if any socket error occurspublic int getBinaryEncodeType()
CodecgetBinaryEncodeType in interface Codec<InputStream>Copyright © 2025 SingleStore. All rights reserved.