Method
decodeBytes
(InputStream input, OutputStream output, byte[] buffer)
Source from the content-addressed store, hash-verified
| 31 | } |
| 32 | |
| 33 | private static long decodeBytes(InputStream input, OutputStream output, byte[] buffer) |
| 34 | throws IOException { |
| 35 | long totalOut = 0; |
| 36 | int readBytes; |
| 37 | BrotliInputStream in = new BrotliInputStream(input); |
| 38 | try { |
| 39 | while ((readBytes = in.read(buffer)) >= 0) { |
| 40 | output.write(buffer, 0, readBytes); |
| 41 | totalOut += readBytes; |
| 42 | } |
| 43 | } finally { |
| 44 | in.close(); |
| 45 | } |
| 46 | return totalOut; |
| 47 | } |
| 48 | |
| 49 | public static void main(String... args) throws IOException { |
| 50 | if (args.length == 0) { |
Tested by
no test coverage detected