List of utility methods to do Decompress Byte Array
String | decompressString(byte[] compressedString) De-compresses a GZip compressed byte array. ByteArrayInputStream bis = new ByteArrayInputStream(compressedString); GZIPInputStream gis; StringBuilder sb = new StringBuilder(); try { gis = new GZIPInputStream(bis); BufferedReader br = new BufferedReader(new InputStreamReader(gis, "UTF-8")); String line; while ((line = br.readLine()) != null) { ... |
String | decompressStringFromByteArray(byte[] compressedString) decompress String From Byte Array StringBuilder stringBuilder = new StringBuilder(); try { GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedString)); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gzipInputStream, "UTF-8")); String line; while ((line = bufferedReader.readLine()) != null) { stringBuilder.append(line); } catch (IOException e) { e.printStackTrace(); return stringBuilder.toString(); |