Class ReaderParameter

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

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

      • reader

        private final java.io.Reader reader
      • length

        private final long length
      • noBackslashEscapes

        private final boolean noBackslashEscapes
    • Constructor Detail

      • ReaderParameter

        public ReaderParameter​(java.io.Reader reader,
                               long length,
                               boolean noBackslashEscapes)
        Constructor.
        Parameters:
        reader - reader to write
        length - max length to write (can be null)
        noBackslashEscapes - must backslash be escape
      • ReaderParameter

        public ReaderParameter​(java.io.Reader reader,
                               boolean noBackslashEscapes)
    • Method Detail

      • writeTo

        public void writeTo​(PacketOutputStream pos)
                     throws java.io.IOException
        Write reader to database in text format.
        Specified by:
        writeTo in interface ParameterHolder
        Parameters:
        pos - database outputStream
        Throws:
        java.io.IOException - if any error occur when reading reader
      • getApproximateTextProtocolLength

        public long getApproximateTextProtocolLength()
        Return approximated data calculated length for rewriting queries.
        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