MCPcopy
hub / github.com/google/brotli / decompress

Method decompress

java/org/brotli/dec/Decoder.java:27–54  ·  view source on GitHub ↗
(String fromPath, String toPath, byte[] buffer)

Source from the content-addressed store, hash-verified

25 }
26
27 private static void decompress(String fromPath, String toPath, byte[] buffer) throws IOException {
28 long start;
29 long bytesDecoded;
30 long end;
31 InputStream in = null;
32 OutputStream out = null;
33 try {
34 in = new FileInputStream(fromPath);
35 out = new FileOutputStream(toPath);
36 start = System.nanoTime();
37 bytesDecoded = decodeBytes(in, out, buffer);
38 end = System.nanoTime();
39 } finally {
40 if (in != null) {
41 in.close(); // Hopefully, does not throw exception.
42 }
43 if (out != null) {
44 out.close();
45 }
46 }
47
48 double timeDelta = (end - start) / 1000000000.0;
49 if (timeDelta <= 0) {
50 return;
51 }
52 double mbDecoded = bytesDecoded / (1024.0 * 1024.0);
53 System.out.println(mbDecoded / timeDelta + " MiB/s");
54 }
55
56 public static void main(String... args) throws IOException {
57 if (args.length != 2 && args.length != 3) {

Callers 1

mainMethod · 0.95

Calls 2

decodeBytesMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected