ByteBuf using the Snappy framing format.
See Snappy framing format.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | MIN_COMPRESSIBLE_LENGTH
The minimum amount that we'll consider actually attempting to compress. |
| private final int | |
| private final Snappy | |
| private static final int | SNAPPY_SLICE_JUMBO_SIZE
Both 32767 and 65535 are valid lengths for the Snappy framing format |
| private static final short | |
| private boolean | |
| private static final byte[] | STREAM_START
All streams should start with the "Stream identifier", containing chunk type 0xff, a length field of 0x6, and 'sNaPpY' in ASCII. |
| Access | Constructor and Description |
|---|---|
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | calculateAndWriteChecksum(ByteBuf
The data to calculate the checksum for slice, ByteBuf The output buffer to write the checksum to out)Calculates and writes the 4-byte checksum to the output buffer |
| protected void | encode(ChannelHandlerContext
the ctx, ByteBuf ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode in, ByteBuf the out)ByteBuf into which the encoded message will be writtenImplements abstract io. ByteBuf.
|
| private static void | |
| public static SnappyFrameEncoder | |
| private static void | writeChunkLength(ByteBuf
The buffer to write to out, int The length to write chunkLength)Writes the 2-byte chunk length to the output buffer. |
| private static void |
| MIN_COMPRESSIBLE_LENGTH | back to summary |
|---|---|
| private static final int MIN_COMPRESSIBLE_LENGTH The minimum amount that we'll consider actually attempting to compress. This value is preamble + the minimum length our Snappy service will compress (instead of just emitting a literal). | |
| sliceSize | back to summary |
|---|---|
| private final int sliceSize | |
| snappy | back to summary |
|---|---|
| private final Snappy snappy | |
| SNAPPY_SLICE_JUMBO_SIZE | back to summary |
|---|---|
| private static final int SNAPPY_SLICE_JUMBO_SIZE Both 32767 and 65535 are valid lengths for the Snappy framing format | |
| SNAPPY_SLICE_SIZE | back to summary |
|---|---|
| private static final short SNAPPY_SLICE_SIZE | |
| started | back to summary |
|---|---|
| private boolean started | |
| STREAM_START | back to summary |
|---|---|
| private static final byte[] STREAM_START All streams should start with the "Stream identifier", containing chunk type 0xff, a length field of 0x6, and 'sNaPpY' in ASCII. | |
| SnappyFrameEncoder | back to summary |
|---|---|
| public SnappyFrameEncoder() | |
| SnappyFrameEncoder | back to summary |
|---|---|
| private SnappyFrameEncoder(int sliceSize) | |
| calculateAndWriteChecksum | back to summary |
|---|---|
| private static void calculateAndWriteChecksum(ByteBuf slice, ByteBuf out) Calculates and writes the 4-byte checksum to the output buffer | |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |
| setChunkLength | back to summary |
|---|---|
| private static void setChunkLength(ByteBuf out, int lengthIdx) | |
| snappyEncoderWithJumboFrames | back to summary |
|---|---|
| public static SnappyFrameEncoder snappyEncoderWithJumboFrames() Create a new instance with a 65535 chunk size. | |
| writeChunkLength | back to summary |
|---|---|
| private static void writeChunkLength(ByteBuf out, int chunkLength) Writes the 2-byte chunk length to the output buffer.
| |
| writeUnencodedChunk | back to summary |
|---|---|
| private static void writeUnencodedChunk(ByteBuf in, ByteBuf out, int dataLength) | |