List of utility methods to do Ungzip File
File | ungzip(File gzip, File toDir) ungzip toDir.mkdirs(); File out = new File(toDir, gzip.getName()); GZIPInputStream gin = null; FileOutputStream fout = null; try { FileInputStream fin = new FileInputStream(gzip); gin = new GZIPInputStream(fin); fout = new FileOutputStream(out); ... |
void | unGzip(File inFile, File outFile) Uncompresses a Gzipped file GZIPInputStream gIn = new GZIPInputStream(new FileInputStream(inFile)); FileOutputStream fos = new FileOutputStream(outFile); byte[] buffer = new byte[100000]; int len; while ((len = gIn.read(buffer)) > 0) { fos.write(buffer, 0, len); gIn.close(); ... |
void | unGzip(File sourceZipFile, String destFolder, String destFile) un Gzip byte[] buffer = new byte[BUFFER_SIZE]; FileInputStream fileIn = new FileInputStream(sourceZipFile); GZIPInputStream gZIPInputStream = new GZIPInputStream(fileIn); FileOutputStream fileOutputStream = new FileOutputStream(destFolder + "/" + destFile); int bytes_read; while ((bytes_read = gZIPInputStream.read(buffer)) > 0) { fileOutputStream.write(buffer, 0, bytes_read); gZIPInputStream.close(); fileOutputStream.close(); |
File | unGzip(final File compressedInputFile, final File outputDir) Ungzip an input file into an output file. String uncompressedOutputFileName = null; if (compressedInputFile.getName().endsWith(".gz")) { uncompressedOutputFileName = compressedInputFile.getName().substring(0, compressedInputFile.getName().length() - 3); } else if (compressedInputFile.getName().endsWith(".tgz")) { uncompressedOutputFileName = compressedInputFile.getName().substring(0, compressedInputFile.getName().length() - 3) + "tar"; } else { ... |
File | unGzip(final File inputFile, final File outputDir) Ungzip an input file into an output file. System.out.println(String.format("Ungzipping %s to dir %s.", inputFile.getAbsolutePath(), outputDir.getAbsolutePath())); final File outputFile = new File(outputDir, inputFile.getName().substring(0, inputFile.getName().length() - 3)); final GZIPInputStream in = new GZIPInputStream(new FileInputStream(inputFile)); final FileOutputStream out = new FileOutputStream(outputFile); for (int c = in.read(); c != -1; c = in.read()) { out.write(c); ... |
InputStream | ungzip(InputStream ins) ungzip return new GZIPInputStream(ins); |
void | ungzip(String gzipFile, String newFile) ungzip 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); ... |
boolean | ungzipFile(String inputFileName, String outputFileName) ungzip File GZIPInputStream in = null; FileOutputStream out = null; try { in = new GZIPInputStream(new FileInputStream(new File(inputFileName))); out = new FileOutputStream(new File(outputFileName)); final int BUFSIZ = 102400; byte inbuf[] = new byte[BUFSIZ]; int n; ... |