+ System.out.print("Output file name (the input file name should be the same as output but without file extension): ");
+ out = System.console().readLine();
+ base = out.substring(0, out.lastIndexOf("."));
+ compressGzip(base, base + "_EDITED.gz");
+ processFile(true, new File(base + "_EDITED.gz"), DatatypeConverter.parseHexBinary(key), new File(out));
+ } else {
+ System.out.print("Input file name: ");
+ String in = System.console().readLine();
+ base = in.substring(0, in.lastIndexOf("."));
+ processFile(false, new File(in), DatatypeConverter.parseHexBinary(key),
+ new File(base + ".gz"));
+ decompressGzip(base + ".gz", base);
+ out = base;
+ }
+ System.out.print("Done. Check the directory for the " + base + (encrypt ? "_EDITED" : "") + ".gz archive and the " + out + " file!\nPress any key to exit...");
+ try (GzipCompressorOutputStream out = new GzipCompressorOutputStream(new FileOutputStream(gzipFile), param); FileInputStream fi = new FileInputStream(file)) {
+ try (GzipCompressorInputStream in = new GzipCompressorInputStream(new FileInputStream(gzipFile)); FileOutputStream fo = new FileOutputStream(file)) {