public interface PacketWriter
extends java.nio.channels.Channel
Modifier and Type | Method and Description |
---|---|
static int |
calculatePadLength(int len,
int blockSize,
boolean etmMode) |
IoWriteFuture |
writePacket(Buffer buffer)
Encode and send the given buffer.
|
IoWriteFuture writePacket(Buffer buffer) throws java.io.IOException
buffer
- the buffer to encode and send. NOTE: the buffer must not be touched until the returned
write future is completed.IoWriteFuture
that can be used to check when the packet has actually been sentjava.io.IOException
- if an error occurred when encoding sending the packetstatic int calculatePadLength(int len, int blockSize, boolean etmMode)
len
- The packet payload sizeblockSize
- The cipher block sizeetmMode
- Whether using "encrypt-then-MAC" mode