|
|
@ -18,10 +18,14 @@ public class Gzip { |
|
|
|
return compressed; |
|
|
|
} |
|
|
|
|
|
|
|
public static byte[] decompress(byte[] compressed) throws IOException { |
|
|
|
public static byte[] decompress(byte[] compressed) { |
|
|
|
try { |
|
|
|
ByteArrayInputStream bis = new ByteArrayInputStream(compressed); |
|
|
|
GZIPInputStream gis = new GZIPInputStream(bis); |
|
|
|
return readAll(gis); |
|
|
|
} catch (Exception e) { |
|
|
|
return compressed; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static byte[] readAll(InputStream input) throws IOException { |
|
|
|