public class StandardPacketInputStream extends AbstractPacketInputStream
| Modifier and Type | Field and Description |
|---|---|
protected int |
lastPacketLength |
protected byte[] |
mysqlHeader |
enableNetworkStatistics, inputStream, MAX_PACKET_SIZE, maxQuerySizeToLog, mysqlSeqNo, REUSABLE_BUFFER_LENGTH, reusableArray, serverThreadLog, threadId, timestampAfterRead, traceCache| Constructor and Description |
|---|
StandardPacketInputStream(InputStream in,
Options options,
long threadId)
Constructor of standard socket MySQL packet stream reader.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
create(byte[] value)
Constructor for single Data (using text format).
|
static byte[] |
create(byte[][] row,
ColumnType[] columnTypes)
Create Buffer with Text protocol values.
|
protected void |
doTrace(int offset,
int length,
byte[] rawBytes) |
int |
getCompressLastPacketSeq() |
InputStream |
getInputStream()
Get current input stream for creating compress input stream, to avoid losing already read bytes
in case of pipelining.
|
Buffer |
getPacket(boolean reUsable) |
byte[] |
getPacketArray(boolean reUsable)
Get next packet.
|
protected void |
readMysqlStream(byte[] rawBytes,
int off,
int remaining) |
clearNetworkStatistics, close, enableNetworkStatistics, getLastPacketSeq, getTimestampAfterRead, setServerThreadId, setTraceCacheprotected byte[] mysqlHeader
protected int lastPacketLength
public StandardPacketInputStream(InputStream in, Options options, long threadId)
in - streamoptions - connection optionsthreadId - thread idpublic Buffer getPacket(boolean reUsable) throws IOException
getPacket in interface PacketInputStreamgetPacket in class AbstractPacketInputStreamIOExceptionpublic byte[] getPacketArray(boolean reUsable)
throws IOException
getPacketArray in interface PacketInputStreamgetPacketArray in class AbstractPacketInputStreamreUsable - if can use existing reusable buffer to avoid creating arrayIOException - if socket exception occur.protected void readMysqlStream(byte[] rawBytes,
int off,
int remaining)
throws IOException
readMysqlStream in class AbstractPacketInputStreamIOExceptionprotected void doTrace(int offset,
int length,
byte[] rawBytes)
doTrace in class AbstractPacketInputStreampublic int getCompressLastPacketSeq()
getCompressLastPacketSeq in interface PacketInputStreamgetCompressLastPacketSeq in class AbstractPacketInputStreampublic static byte[] create(byte[] value)
value - valuepublic static byte[] create(byte[][] row,
ColumnType[] columnTypes)
row - row datacolumnTypes - column typespublic InputStream getInputStream()
Copyright © 2022 oceanbase.com. All rights reserved.