Class Reader
java.lang.Object
org.mariadb.jdbc.client.socket.Reader
Packet reader
-
Constructor Summary
ConstructorsConstructorDescriptionReader(InputStream in, Configuration conf, MutableByte sequence) Constructor of standard socket MySQL packet stream reader. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.mariadb.jdbc.client.ReadableByteBufreadableBufFromArray(byte[] buf) byte[]readPacket(boolean traceEnable) Get the next MySQL packet.org.mariadb.jdbc.client.ReadableByteBuforg.mariadb.jdbc.client.ReadableByteBufreadReusablePacket(boolean traceEnable) voidsetServerThreadId(Long serverThreadId, HostAddress hostAddress) Set server thread id.
-
Constructor Details
-
Reader
Constructor of standard socket MySQL packet stream reader.- Parameters:
in- streamconf- connection optionssequence- current increment sequence
-
-
Method Details
-
readableBufFromArray
public org.mariadb.jdbc.client.ReadableByteBuf readableBufFromArray(byte[] buf) -
readReusablePacket
- Throws:
IOException
-
readReusablePacket
public org.mariadb.jdbc.client.ReadableByteBuf readReusablePacket(boolean traceEnable) throws IOException - Throws:
IOException
-
readPacket
Get the next MySQL packet. If the packet is more than 16M, read as many packets needed to finish reading MySQL packet. (first that has no length = 16Mb)- Parameters:
traceEnable- must trace packet.- Returns:
- array packet.
- Throws:
IOException- if socket exception occur.
-
getSequence
-
close
- Throws:
IOException
-
setServerThreadId
Set server thread id.- Parameters:
serverThreadId- current server thread id.hostAddress- host information
-