Class StandardPacketOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.mariadb.jdbc.internal.io.output.AbstractPacketOutputStream
-
- org.mariadb.jdbc.internal.io.output.StandardPacketOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,PacketOutputStream
public class StandardPacketOutputStream extends AbstractPacketOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private static Logger
logger
private static int
MAX_PACKET_LENGTH
private int
maxPacketLength
-
Fields inherited from class org.mariadb.jdbc.internal.io.output.AbstractPacketOutputStream
buf, cmdLength, maxAllowedPacket, maxQuerySizeToLog, permitTrace, pos, seqNo, serverThreadLog, traceCache
-
-
Constructor Summary
Constructors Constructor Description StandardPacketOutputStream(java.io.OutputStream out, Options options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
flushBuffer(boolean commandEnd)
Flush the internal buffer.int
getMaxPacketLength()
int
initialPacketPos()
void
setMaxAllowedPacket(int maxAllowedPacket)
void
startPacket(int seqNo)
void
writeEmptyPacket()
Write an empty com.-
Methods inherited from class org.mariadb.jdbc.internal.io.output.AbstractPacketOutputStream
bufferIsDataAfterMark, checkMaxAllowedLength, checkRemainingSize, exceedMaxLength, flush, flushBufferStopAtMark, getMaxAllowedPacket, getOutputStream, isMarked, mark, permitTrace, resetMark, setServerThreadId, setTraceCache, write, write, write, write, write, write, write, write, write, writeBytes, writeBytesEscaped, writeEmptyPacket, writeFieldLength, writeInt, writeLong, writeShort
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.internal.io.output.PacketOutputStream
close
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
MAX_PACKET_LENGTH
private static final int MAX_PACKET_LENGTH
- See Also:
- Constant Field Values
-
maxPacketLength
private int maxPacketLength
-
-
Constructor Detail
-
StandardPacketOutputStream
public StandardPacketOutputStream(java.io.OutputStream out, Options options)
-
-
Method Detail
-
getMaxPacketLength
public int getMaxPacketLength()
- Specified by:
getMaxPacketLength
in classAbstractPacketOutputStream
-
startPacket
public void startPacket(int seqNo)
- Specified by:
startPacket
in interfacePacketOutputStream
- Specified by:
startPacket
in classAbstractPacketOutputStream
-
setMaxAllowedPacket
public void setMaxAllowedPacket(int maxAllowedPacket)
- Specified by:
setMaxAllowedPacket
in interfacePacketOutputStream
- Specified by:
setMaxAllowedPacket
in classAbstractPacketOutputStream
-
initialPacketPos
public int initialPacketPos()
-
flushBuffer
protected void flushBuffer(boolean commandEnd) throws java.io.IOException
Flush the internal buffer.- Specified by:
flushBuffer
in classAbstractPacketOutputStream
- Parameters:
commandEnd
- command end- Throws:
java.io.IOException
- id connection error occur.
-
writeEmptyPacket
public void writeEmptyPacket() throws java.io.IOException
Write an empty com.- Specified by:
writeEmptyPacket
in interfacePacketOutputStream
- Specified by:
writeEmptyPacket
in classAbstractPacketOutputStream
- Throws:
java.io.IOException
- if socket error occur.
-
-