forked from Cookies_Github_mirror/AquaDX
[O] Reduce duplicate code
This commit is contained in:
@@ -12,10 +12,10 @@ import java.util.zip.Inflater;
|
||||
*/
|
||||
public class Compression {
|
||||
|
||||
public static byte[] decompress(byte[] src) {
|
||||
public static byte[] decompress(byte[] src, boolean nowrap) {
|
||||
ByteBuf result = Unpooled.buffer();
|
||||
byte[] buffer = new byte[100];
|
||||
Inflater decompressor = new Inflater();
|
||||
Inflater decompressor = new Inflater(nowrap);
|
||||
decompressor.setInput(src);
|
||||
|
||||
try {
|
||||
@@ -36,6 +36,10 @@ public class Compression {
|
||||
|
||||
}
|
||||
|
||||
public static byte[] decompress(byte[] src) {
|
||||
return decompress(src, false);
|
||||
}
|
||||
|
||||
public static byte[] compress(byte[] src) {
|
||||
ByteBuf result = Unpooled.buffer();
|
||||
byte[] buffer = new byte[100];
|
||||
|
||||
Reference in New Issue
Block a user