List of utility methods to do Ungzip
void | decompressGZIP(String sourceFilename, String targetFilename) decompress GZIP copyStream(new GZIPInputStream(new FileInputStream(sourceFilename)), new FileOutputStream(targetFilename)); |
void | decompressGzipFile(String gzipFile, String newFile) decompress Gzip File try { FileInputStream fis = new FileInputStream(gzipFile); GZIPInputStream gis = new GZIPInputStream(fis); FileOutputStream fos = new FileOutputStream(newFile); byte[] buffer = new byte[1024]; int len; while ((len = gis.read(buffer)) != -1) { fos.write(buffer, 0, len); ... |
String | decompressGzipString(String gzipFile) decompressGzipString -- Decompress a .gz file into a String. try { FileInputStream fis = new FileInputStream(gzipFile); ByteArrayOutputStream bos; try (GZIPInputStream gis = new GZIPInputStream(fis)) { bos = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len; while ((len = gis.read(buffer)) != -1) { ... |