Class StreamParameter

  • All Implemented Interfaces:
    java.lang.Cloneable, ParameterHolder

    public class StreamParameter
    extends java.lang.Object
    implements java.lang.Cloneable, ParameterHolder
    • Field Detail

      • is

        private final java.io.InputStream is
      • length

        private final long length
      • noBackslashEscapes

        private final boolean noBackslashEscapes
    • Constructor Detail

      • StreamParameter

        public StreamParameter​(java.io.InputStream is,
                               long length,
                               boolean noBackslashEscapes)
        Constructor.
        Parameters:
        is - stream to write
        length - 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 interface ParameterHolder
        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 interface ParameterHolder
        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 interface ParameterHolder
        Parameters:
        pos - socket output stream
        Throws:
        java.io.IOException - if socket error occur
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface ParameterHolder
        Overrides:
        toString in class java.lang.Object