public class CompressedPacketSender extends java.lang.Object implements MessageSender<NativePacketPayload>
MessageSender for the compressed protocol.
TODO: add support for pre-allocated buffer for large packets (if there's a demonstrable perf improvement)| Modifier and Type | Field and Description |
|---|---|
static int |
COMP_HEADER_LENGTH |
static int |
MIN_COMPRESS_LEN |
| Constructor and Description |
|---|
CompressedPacketSender(java.io.BufferedOutputStream outputStream) |
| Modifier and Type | Method and Description |
|---|---|
void |
send(byte[] packet,
int packetLen,
byte packetSequence)
Packet sender implementation for the compressed MySQL protocol.
|
void |
stop()
Shut down this packet sender and deallocate any resources.
|
MessageSender<NativePacketPayload> |
undecorate()
Return the previous PacketSender instance from the decorators chain or the current PacketSender
if it is the first entry in a chain.
|
MessageSender<NativePacketPayload> |
undecorateAll()
Return a PacketSender instance free of decorators.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsend, send, setMaxAllowedPacketpublic static final int COMP_HEADER_LENGTH
public static final int MIN_COMPRESS_LEN
public CompressedPacketSender(java.io.BufferedOutputStream outputStream)
public void stop()
public void send(byte[] packet,
int packetLen,
byte packetSequence)
throws java.io.IOException
send in interface MessageSender<NativePacketPayload>packet - data bytespacketLen - packet lengthpacketSequence - sequence idjava.io.IOException - if i/o exception occurspublic MessageSender<NativePacketPayload> undecorateAll()
MessageSenderundecorateAll in interface MessageSender<NativePacketPayload>MessageSender instancepublic MessageSender<NativePacketPayload> undecorate()
MessageSenderundecorate in interface MessageSender<NativePacketPayload>MessageSender instance