diff --git a/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedDecoder.java b/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameDecoder.java similarity index 95% rename from codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedDecoder.java rename to codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameDecoder.java index 7832be3332..0697ae0efa 100644 --- a/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameDecoder.java @@ -15,7 +15,6 @@ */ package io.netty.handler.codec.compression; -import static io.netty.handler.codec.compression.Snappy.validateChecksum; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.channel.ChannelHandlerContext; @@ -24,6 +23,8 @@ import io.netty.handler.codec.ByteToMessageDecoder; import java.util.Arrays; import java.util.List; +import static io.netty.handler.codec.compression.Snappy.*; + /** * Uncompresses a {@link ByteBuf} encoded with the Snappy framing format. * @@ -32,10 +33,10 @@ import java.util.List; * Note that by default, validation of the checksum header in each chunk is * DISABLED for performance improvements. If performance is less of an issue, * or if you would prefer the safety that checksum validation brings, please - * use the {@link #SnappyFramedDecoder(boolean)} constructor with the argument + * use the {@link #SnappyFrameDecoder(boolean)} constructor with the argument * set to {@code true}. */ -public class SnappyFramedDecoder extends ByteToMessageDecoder { +public class SnappyFrameDecoder extends ByteToMessageDecoder { private enum ChunkType { STREAM_IDENTIFIER, @@ -57,9 +58,9 @@ public class SnappyFramedDecoder extends ByteToMessageDecoder { /** * Creates a new snappy-framed decoder with validation of checksums * turned OFF. To turn checksum validation on, please use the alternate - * {@link #SnappyFramedDecoder(boolean)} constructor. + * {@link #SnappyFrameDecoder(boolean)} constructor. */ - public SnappyFramedDecoder() { + public SnappyFrameDecoder() { this(false); } @@ -72,7 +73,7 @@ public class SnappyFramedDecoder extends ByteToMessageDecoder { * uncompressed data, and if the checksums do not match, a suitable * {@link DecompressionException} will be thrown */ - public SnappyFramedDecoder(boolean validateChecksums) { + public SnappyFrameDecoder(boolean validateChecksums) { this.validateChecksums = validateChecksums; } diff --git a/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedEncoder.java b/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameEncoder.java similarity index 98% rename from codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedEncoder.java rename to codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameEncoder.java index 1cc5301ab7..3759e1a335 100644 --- a/codec/src/main/java/io/netty/handler/codec/compression/SnappyFramedEncoder.java +++ b/codec/src/main/java/io/netty/handler/codec/compression/SnappyFrameEncoder.java @@ -27,7 +27,7 @@ import static io.netty.handler.codec.compression.Snappy.*; * * See http://code.google.com/p/snappy/source/browse/trunk/framing_format.txt */ -public class SnappyFramedEncoder extends MessageToByteEncoder { +public class SnappyFrameEncoder extends MessageToByteEncoder { /** * The minimum amount that we'll consider actually attempting to compress. * This value is preamble + the minimum length our Snappy service will diff --git a/codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedDecoderTest.java b/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecoderTest.java similarity index 97% rename from codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedDecoderTest.java rename to codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecoderTest.java index 5c8355fbd5..31fde9c003 100644 --- a/codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedDecoderTest.java +++ b/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameDecoderTest.java @@ -24,12 +24,12 @@ import org.junit.Test; import static io.netty.util.ReferenceCountUtil.releaseLater; import static org.junit.Assert.*; -public class SnappyFramedDecoderTest { +public class SnappyFrameDecoderTest { private EmbeddedChannel channel; @Before public void initChannel() { - channel = new EmbeddedChannel(new SnappyFramedDecoder()); + channel = new EmbeddedChannel(new SnappyFrameDecoder()); } @Test(expected = DecompressionException.class) @@ -133,7 +133,7 @@ public class SnappyFramedDecoderTest { @Test(expected = DecompressionException.class) public void testInvalidChecksumThrowsException() throws Exception { - EmbeddedChannel channel = new EmbeddedChannel(new SnappyFramedDecoder(true)); + EmbeddedChannel channel = new EmbeddedChannel(new SnappyFrameDecoder(true)); // checksum here is presented as 0 ByteBuf in = Unpooled.wrappedBuffer(new byte[] { @@ -146,7 +146,7 @@ public class SnappyFramedDecoderTest { @Test public void testInvalidChecksumDoesNotThrowException() throws Exception { - EmbeddedChannel channel = new EmbeddedChannel(new SnappyFramedDecoder(true)); + EmbeddedChannel channel = new EmbeddedChannel(new SnappyFrameDecoder(true)); // checksum here is presented as a282986f (little endian) ByteBuf in = Unpooled.wrappedBuffer(new byte[] { diff --git a/codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedEncoderTest.java b/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameEncoderTest.java similarity index 98% rename from codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedEncoderTest.java rename to codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameEncoderTest.java index 9b1d606e14..6dbcb1ee74 100644 --- a/codec/src/test/java/io/netty/handler/codec/compression/SnappyFramedEncoderTest.java +++ b/codec/src/test/java/io/netty/handler/codec/compression/SnappyFrameEncoderTest.java @@ -25,12 +25,12 @@ import org.junit.Test; import static io.netty.util.ReferenceCountUtil.*; import static org.junit.Assert.*; -public class SnappyFramedEncoderTest { +public class SnappyFrameEncoderTest { private EmbeddedChannel channel; @Before public void setUp() { - channel = new EmbeddedChannel(new SnappyFramedEncoder()); + channel = new EmbeddedChannel(new SnappyFrameEncoder()); } @Test diff --git a/codec/src/test/java/io/netty/handler/codec/compression/SnappyIntegrationTest.java b/codec/src/test/java/io/netty/handler/codec/compression/SnappyIntegrationTest.java index 6e6852ae0e..63a3886f41 100644 --- a/codec/src/test/java/io/netty/handler/codec/compression/SnappyIntegrationTest.java +++ b/codec/src/test/java/io/netty/handler/codec/compression/SnappyIntegrationTest.java @@ -33,12 +33,12 @@ public class SnappyIntegrationTest extends IntegrationTest { @Override protected EmbeddedChannel createEncoderEmbeddedChannel() { - return new EmbeddedChannel(new SnappyFramedEncoder()); + return new EmbeddedChannel(new SnappyFrameEncoder()); } @Override protected EmbeddedChannel createDecoderEmbeddedChannel() { - return new EmbeddedChannel(new SnappyFramedDecoder()); + return new EmbeddedChannel(new SnappyFrameDecoder()); } @Test