Skip to content

Instantly share code, notes, and snippets.

View GavinGoGaming's full-sized avatar
🔥
KLASH DEVELOPMENT

Gavin Fox GavinGoGaming

🔥
KLASH DEVELOPMENT
View GitHub Profile
public static String decompress(byte[] compressedData) throws IOException {
try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(compressedData);
GZIPInputStream gzipInputStream = new GZIPInputStream(byteArrayInputStream)) {
StringBuilder outStr = new StringBuilder();
byte[] buffer = new byte[1024];
int len;
while ((len = gzipInputStream.read(buffer)) != -1) {
outStr.append(new String(buffer, 0, len, "UTF-8"));
}