Package org.mariadb.jdbc.client.socket
Interface Reader
-
- All Known Implementing Classes:
PacketReader
public interface ReaderPacket Reader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close streamMutableIntgetSequence()Get current sequence objectorg.mariadb.jdbc.client.ReadableByteBufreadPacket(boolean reUsable)Get next MySQL packet.org.mariadb.jdbc.client.ReadableByteBufreadPacket(boolean reUsable, boolean traceEnable)Get next MySQL packet.voidsetServerThreadId(Long serverThreadId, HostAddress hostAddress)Set server thread id.
-
-
-
Method Detail
-
readPacket
org.mariadb.jdbc.client.ReadableByteBuf readPacket(boolean reUsable) throws IOExceptionGet 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 IOExceptionGet 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 arraytraceEnable- 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 IOExceptionClose 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
-
-