Rename SPDY header block (de)compressor classes
This commit is contained in:
parent
5311257490
commit
efe27dbce5
@ -37,11 +37,14 @@ abstract class SpdyHeaderBlockCompressor {
|
||||
USE_ZLIB = java7;
|
||||
}
|
||||
|
||||
static SpdyHeaderBlockCompressor newInstance(int compressionLevel, int windowBits, int memLevel) {
|
||||
static SpdyHeaderBlockCompressor newInstance(
|
||||
int compressionLevel, int windowBits, int memLevel) {
|
||||
|
||||
if (USE_ZLIB) {
|
||||
return new SpdyZlibEncoder(compressionLevel);
|
||||
return new SpdyHeaderBlockZlibCompressor(compressionLevel);
|
||||
} else {
|
||||
return new SpdyJZlibEncoder(compressionLevel, windowBits, memLevel);
|
||||
return new SpdyHeaderBlockJZlibCompressor(
|
||||
compressionLevel, windowBits, memLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ import io.netty.buffer.ChannelBuffer;
|
||||
abstract class SpdyHeaderBlockDecompressor {
|
||||
|
||||
static SpdyHeaderBlockDecompressor newInstance() {
|
||||
return new SpdyJZlibDecoder();
|
||||
return new SpdyHeaderBlockJZlibDecompressor();
|
||||
}
|
||||
|
||||
abstract void setInput(ChannelBuffer compressed);
|
||||
|
@ -22,11 +22,11 @@ import io.netty.handler.codec.compression.CompressionException;
|
||||
import io.netty.util.internal.jzlib.JZlib;
|
||||
import io.netty.util.internal.jzlib.ZStream;
|
||||
|
||||
class SpdyJZlibEncoder extends SpdyHeaderBlockCompressor {
|
||||
class SpdyHeaderBlockJZlibCompressor extends SpdyHeaderBlockCompressor {
|
||||
|
||||
private final ZStream z = new ZStream();
|
||||
|
||||
public SpdyJZlibEncoder(int compressionLevel, int windowBits, int memLevel) {
|
||||
public SpdyHeaderBlockJZlibCompressor(int compressionLevel, int windowBits, int memLevel) {
|
||||
if (compressionLevel < 0 || compressionLevel > 9) {
|
||||
throw new IllegalArgumentException(
|
||||
"compressionLevel: " + compressionLevel + " (expected: 0-9)");
|
@ -22,12 +22,12 @@ import io.netty.util.internal.jzlib.ZStream;
|
||||
|
||||
import static io.netty.handler.codec.spdy.SpdyCodecUtil.*;
|
||||
|
||||
class SpdyJZlibDecoder extends SpdyHeaderBlockDecompressor {
|
||||
class SpdyHeaderBlockJZlibDecompressor extends SpdyHeaderBlockDecompressor {
|
||||
|
||||
private final byte[] out = new byte[8192];
|
||||
private final ZStream z = new ZStream();
|
||||
|
||||
public SpdyJZlibDecoder() {
|
||||
public SpdyHeaderBlockJZlibDecompressor() {
|
||||
int resultCode;
|
||||
resultCode = z.inflateInit(JZlib.W_ZLIB);
|
||||
if (resultCode != JZlib.Z_OK) {
|
@ -21,12 +21,12 @@ import io.netty.buffer.ChannelBuffer;
|
||||
|
||||
import static io.netty.handler.codec.spdy.SpdyCodecUtil.*;
|
||||
|
||||
class SpdyZlibEncoder extends SpdyHeaderBlockCompressor {
|
||||
class SpdyHeaderBlockZlibCompressor extends SpdyHeaderBlockCompressor {
|
||||
|
||||
private final byte[] out = new byte[8192];
|
||||
private final Deflater compressor;
|
||||
|
||||
public SpdyZlibEncoder(int compressionLevel) {
|
||||
public SpdyHeaderBlockZlibCompressor(int compressionLevel) {
|
||||
if (compressionLevel < 0 || compressionLevel > 9) {
|
||||
throw new IllegalArgumentException(
|
||||
"compressionLevel: " + compressionLevel + " (expected: 0-9)");
|
Loading…
x
Reference in New Issue
Block a user