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

Method readFile

java/org/brotli/integration/Benchmark.java:17–31  ·  view source on GitHub ↗
(String fileName)

Source from the content-addressed store, hash-verified

15 */
16public class Benchmark {
17 private static byte[] readFile(String fileName) throws IOException {
18 int bufferLength = 65536;
19 byte[] buffer = new byte[bufferLength];
20 ByteArrayOutputStream baos = new ByteArrayOutputStream();
21 FileInputStream fin = new FileInputStream(fileName);
22 try {
23 int bytesRead;
24 while ((bytesRead = fin.read(buffer)) >= 0) {
25 baos.write(buffer, 0, bytesRead);
26 }
27 } finally {
28 fin.close();
29 }
30 return baos.toByteArray();
31 }
32
33 private static long decodeBytes(InputStream input, OutputStream output, byte[] buffer)
34 throws IOException {

Callers 1

mainMethod · 0.95

Calls 3

readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected