public class ChecksummingTransformer extends java.lang.Object implements FrameBodyTransformer
1.1. Checksummed/Compression Serialized Format
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Compressed Chunks | Compressed Length (e1) /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Compressed Length cont. (e1) | Uncompressed Length (e1) /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Uncompressed Length cont. (e1)| Checksum of Lengths (e1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum of Lengths cont. (e1)| Compressed Bytes (e1) +//
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum (e1) ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Compressed Length (e2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Uncompressed Length (e2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum of Lengths (e2) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Compressed Bytes (e2) +//
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum (e2) ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Compressed Length (en) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Uncompressed Length (en) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum of Lengths (en) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Compressed Bytes (en) +//
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum (en) ||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1.2. Checksum Compression Description
The entire payload is broken into n chunks each with a pair of checksums:
Modifier and Type | Method and Description |
---|---|
java.util.EnumSet<Frame.Header.Flag> |
getOutboundHeaderFlags()
Returns an EnumSet of the flags that should be added to the header for any message whose frame body has been
modified by the transformer.
|
static ChecksummingTransformer |
getTransformer(ChecksumType checksumType,
Compressor compressor) |
io.netty.buffer.ByteBuf |
transformInbound(io.netty.buffer.ByteBuf inputBuf,
java.util.EnumSet<Frame.Header.Flag> flags)
Accepts the input buffer representing the frame body of an incoming message and applies a transformation.
|
io.netty.buffer.ByteBuf |
transformOutbound(io.netty.buffer.ByteBuf inputBuf)
Accepts an input buffer representing the frame body of an outbound message and applies a transformation.
|
public static ChecksummingTransformer getTransformer(ChecksumType checksumType, Compressor compressor)
public java.util.EnumSet<Frame.Header.Flag> getOutboundHeaderFlags()
FrameBodyTransformer
getOutboundHeaderFlags
in interface FrameBodyTransformer
public io.netty.buffer.ByteBuf transformOutbound(io.netty.buffer.ByteBuf inputBuf)
FrameBodyTransformer
transformOutbound
in interface FrameBodyTransformer
inputBuf
- the frame body from an outgoing messagepublic io.netty.buffer.ByteBuf transformInbound(io.netty.buffer.ByteBuf inputBuf, java.util.EnumSet<Frame.Header.Flag> flags)
FrameBodyTransformer
transformInbound
in interface FrameBodyTransformer
inputBuf
- the frame body from an inbound messageCopyright © 2009-2020 The Apache Software Foundation