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

Method decompress

java/org/brotli/dec/SynthTest.java:27–41  ·  view source on GitHub ↗
(byte[] data)

Source from the content-addressed store, hash-verified

25public class SynthTest {
26
27 private byte[] decompress(byte[] data) throws IOException {
28 byte[] buffer = new byte[65536];
29 ByteArrayInputStream input = new ByteArrayInputStream(data);
30 ByteArrayOutputStream output = new ByteArrayOutputStream();
31 InputStream brotliInput = newBrotliInputStream(input);
32 while (true) {
33 int len = brotliInput.read(buffer, 0, buffer.length);
34 if (len <= 0) {
35 break;
36 }
37 output.write(buffer, 0, len);
38 }
39 brotliInput.close();
40 return output.toByteArray();
41 }
42
43 private void checkSynth(byte[] compressed, boolean expectSuccess, String expectedOutput) {
44 byte[] expected = readUniBytes(expectedOutput);

Callers 1

checkSynthMethod · 0.95

Calls 4

newBrotliInputStreamMethod · 0.80
readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected