Class StreamParameter
- java.lang.Object
-
- org.mariadb.jdbc.internal.com.send.parameters.StreamParameter
-
- All Implemented Interfaces:
Cloneable,ParameterHolder
public class StreamParameter extends Object implements Cloneable, ParameterHolder
-
-
Field Summary
-
Fields inherited from interface org.mariadb.jdbc.internal.com.send.parameters.ParameterHolder
BINARY_INTRODUCER, QUOTE
-
-
Constructor Summary
Constructors Constructor Description StreamParameter(InputStream is, boolean noBackSlashEscapes)StreamParameter(InputStream is, long length, boolean noBackslashEscapes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanBeLongData()intgetApproximateTextProtocolLength()Return approximated data calculated length.ColumnTypegetColumnType()booleanisNullData()StringtoString()voidwriteBinary(PacketOutputStream pos)Write data to socket in binary format.voidwriteLongData(PacketOutputStream pos)voidwriteTo(PacketOutputStream pos)Write stream in text format.
-
-
-
Constructor Detail
-
StreamParameter
public StreamParameter(InputStream is, long length, boolean noBackslashEscapes)
Constructor.- Parameters:
is- stream to writelength- max length to write (if null the whole stream will be send)noBackslashEscapes- must backslash be escape
-
StreamParameter
public StreamParameter(InputStream is, boolean noBackSlashEscapes)
-
-
Method Detail
-
writeTo
public void writeTo(PacketOutputStream pos) throws IOException
Write stream in text format.- Specified by:
writeToin interfaceParameterHolder- Parameters:
pos- database outputStream- Throws:
IOException- if any error occur when reader stream
-
getApproximateTextProtocolLength
public int getApproximateTextProtocolLength()
Return approximated data calculated length.- Specified by:
getApproximateTextProtocolLengthin interfaceParameterHolder- Returns:
- approximated data length.
-
writeBinary
public void writeBinary(PacketOutputStream pos) throws IOException
Write data to socket in binary format.- Specified by:
writeBinaryin interfaceParameterHolder- Parameters:
pos- socket output stream- Throws:
IOException- if socket error occur
-
writeLongData
public void writeLongData(PacketOutputStream pos) throws IOException
- Specified by:
writeLongDatain interfaceParameterHolder- Throws:
IOException
-
toString
public String toString()
- Specified by:
toStringin interfaceParameterHolder- Overrides:
toStringin classObject
-
getColumnType
public ColumnType getColumnType()
- Specified by:
getColumnTypein interfaceParameterHolder
-
isNullData
public boolean isNullData()
- Specified by:
isNullDatain interfaceParameterHolder
-
canBeLongData
public boolean canBeLongData()
- Specified by:
canBeLongDatain interfaceParameterHolder
-
-