From 0bea10b0b064d7983a1422af792eeb70e511eac4 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 23 Feb 2016 11:14:08 +0100 Subject: [PATCH] [#4892] Make Snappy class public Motivation: Some people may want to use the Snappy class directly to encode / decode ByteBufs. Modifications: Make the Snappy class public and final. Result: Easier for people to reuse parts of Netty. --- .../java/io/netty/handler/codec/compression/Snappy.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java b/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java index df4e88a082..9a02f3a0f3 100644 --- a/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java +++ b/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java @@ -21,9 +21,9 @@ import io.netty.buffer.ByteBuf; * Uncompresses an input {@link ByteBuf} encoded with Snappy compression into an * output {@link ByteBuf}. * - * See http://code.google.com/p/snappy/source/browse/trunk/format_description.txt + * See snappy format. */ -class Snappy { +public final class Snappy { private static final int MAX_HT_SIZE = 1 << 14; private static final int MIN_COMPRESSIBLE_BYTES = 15; @@ -598,7 +598,7 @@ class Snappy { * * @param data The input data to calculate the CRC32C checksum of */ - public static int calculateChecksum(ByteBuf data) { + static int calculateChecksum(ByteBuf data) { return calculateChecksum(data, data.readerIndex(), data.readableBytes()); } @@ -608,7 +608,7 @@ class Snappy { * * @param data The input data to calculate the CRC32C checksum of */ - public static int calculateChecksum(ByteBuf data, int offset, int length) { + static int calculateChecksum(ByteBuf data, int offset, int length) { Crc32c crc32 = new Crc32c(); try { if (data.hasArray()) {