Class StreamParameter
- java.lang.Object
-
- org.mariadb.jdbc.internal.com.send.parameters.StreamParameter
-
- All Implemented Interfaces:
java.lang.Cloneable
,ParameterHolder
public class StreamParameter extends java.lang.Object implements java.lang.Cloneable, ParameterHolder
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.InputStream
is
private long
length
private boolean
noBackslashEscapes
-
Fields inherited from interface org.mariadb.jdbc.internal.com.send.parameters.ParameterHolder
BINARY_INTRODUCER, QUOTE
-
-
Constructor Summary
Constructors Constructor Description StreamParameter(java.io.InputStream is, boolean noBackSlashEscapes)
StreamParameter(java.io.InputStream is, long length, boolean noBackslashEscapes)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeLongData()
int
getApproximateTextProtocolLength()
Return approximated data calculated length.ColumnType
getColumnType()
boolean
isNullData()
java.lang.String
toString()
void
writeBinary(PacketOutputStream pos)
Write data to socket in binary format.void
writeLongData(PacketOutputStream pos)
void
writeTo(PacketOutputStream pos)
Write stream in text format.
-
-
-
Constructor Detail
-
StreamParameter
public StreamParameter(java.io.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(java.io.InputStream is, boolean noBackSlashEscapes)
-
-
Method Detail
-
writeTo
public void writeTo(PacketOutputStream pos) throws java.io.IOException
Write stream in text format.- Specified by:
writeTo
in interfaceParameterHolder
- Parameters:
pos
- database outputStream- Throws:
java.io.IOException
- if any error occur when reader stream
-
getApproximateTextProtocolLength
public int getApproximateTextProtocolLength()
Return approximated data calculated length.- Specified by:
getApproximateTextProtocolLength
in interfaceParameterHolder
- Returns:
- approximated data length.
-
writeBinary
public void writeBinary(PacketOutputStream pos) throws java.io.IOException
Write data to socket in binary format.- Specified by:
writeBinary
in interfaceParameterHolder
- Parameters:
pos
- socket output stream- Throws:
java.io.IOException
- if socket error occur
-
writeLongData
public void writeLongData(PacketOutputStream pos) throws java.io.IOException
- Specified by:
writeLongData
in interfaceParameterHolder
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceParameterHolder
- Overrides:
toString
in classjava.lang.Object
-
getColumnType
public ColumnType getColumnType()
- Specified by:
getColumnType
in interfaceParameterHolder
-
isNullData
public boolean isNullData()
- Specified by:
isNullData
in interfaceParameterHolder
-
canBeLongData
public boolean canBeLongData()
- Specified by:
canBeLongData
in interfaceParameterHolder
-
-