Class StandardPacketInputStream

    • Constructor Detail

      • StandardPacketInputStream

        public StandardPacketInputStream​(InputStream in,
                                         Options options,
                                         long threadId)
        Constructor of standard socket MySQL packet stream reader.
        Parameters:
        in - stream
        options - connection options
        threadId - thread id
    • Method Detail

      • create

        public static byte[] create​(byte[] value)
        Constructor for single Data (using text format).
        Parameters:
        value - value
        Returns:
        Buffer
      • create

        public static byte[] create​(byte[][] row,
                                    ColumnType[] columnTypes)
        Create Buffer with Text protocol values.
        Parameters:
        row - row data
        columnTypes - column types
        Returns:
        Buffer
      • getInputStream

        public InputStream getInputStream()
        Get current input stream for creating compress input stream, to avoid losing already read bytes in case of pipelining.
        Specified by:
        getInputStream in interface PacketInputStream
        Returns:
        input stream.
      • getPacketArray

        public byte[] getPacketArray​(boolean reUsable)
                              throws IOException
        Get next packet. If packet is more than 16M, read as many packet needed to finish packet. (first that has not length = 16Mb)
        Specified by:
        getPacketArray in interface PacketInputStream
        Parameters:
        reUsable - if can use existing reusable buffer to avoid creating array
        Returns:
        array packet.
        Throws:
        IOException - if socket exception occur.
      • setServerThreadId

        public void setServerThreadId​(long serverThreadId,
                                      Boolean isMaster)
        Set server thread id.
        Specified by:
        setServerThreadId in interface PacketInputStream
        Parameters:
        serverThreadId - current server thread id.
        isMaster - is server master