Package org.mariadb.jdbc.client.socket

## Interface Reader

All Known Implementing Classes:
  `PacketReader`

    public interface Reader

Packet Reader

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `close()` Close stream
`MutableInt` `getSequence()` Get current sequence object
`org.mariadb.jdbc.client.ReadableByteBuf` `readPacket​(boolean reUsable)` Get next MySQL packet.
`org.mariadb.jdbc.client.ReadableByteBuf` `readPacket​(boolean reUsable, boolean traceEnable)` Get next MySQL packet.
`void` `setServerThreadId​(Long serverThreadId, HostAddress hostAddress)` Set server thread id.

### Method Detail

#### readPacket

    org.mariadb.jdbc.client.ReadableByteBuf readPacket​(boolean reUsable)
                                                throws IOException

Get next MySQL packet. If packet is more than 16M, read as many packet needed to finish reading MySQL packet. (first that has not length = 16Mb)

Parameters:
  `reUsable` - if packet can use existing reusable buf to avoid creating array
Returns:
  array packet.
Throws:
  `IOException` - if socket exception occur.

#### readPacket

    org.mariadb.jdbc.client.ReadableByteBuf readPacket​(boolean reUsable,
                                                       boolean traceEnable)
                                                throws IOException

Get next MySQL packet. If packet is more than 16M, read as many packet needed to finish reading MySQL packet. (first that has not length = 16Mb)

Parameters:
  `reUsable` - if packet can use existing reusable buf to avoid creating array
  `traceEnable` - must trace packet.
Returns:
  array packet.
Throws:
  `IOException` - if socket exception occur.

#### getSequence

    MutableInt getSequence()

Get current sequence object

Returns:
  current sequence

#### close

    void close()
        throws IOException

Close stream

Throws:
  `IOException` - if any error occurs

#### setServerThreadId

    void setServerThreadId​(Long serverThreadId,
                           HostAddress hostAddress)

Set server thread id.

Parameters:
  `serverThreadId` - current server thread id.
  `hostAddress` - host information