MCPcopy Index your code
hub / github.com/google/brotli / run

Method run

java/org/brotli/wrapper/enc/EncoderTest.java:54–79  ·  view source on GitHub ↗
(String entryName)

Source from the content-addressed store, hash-verified

52 }
53
54 private static void run(String entryName) throws Throwable {
55 InputStream bundle = getBundle();
56 byte[] original;
57 try {
58 original = BundleHelper.readEntry(bundle, entryName);
59 } finally {
60 bundle.close();
61 }
62 if (original == null) {
63 throw new RuntimeException("Can't read bundle entry: " + entryName);
64 }
65
66 for (int window = 10; window <= 22; window++) {
67 byte[] compressed =
68 Encoder.compress(original, new Encoder.Parameters().setQuality(6).setWindow(window));
69
70 InputStream decoder = new BrotliInputStream(new ByteArrayInputStream(compressed));
71 try {
72 long originalCrc = BundleHelper.fingerprintStream(new ByteArrayInputStream(original));
73 long crc = BundleHelper.fingerprintStream(decoder);
74 assertEquals(originalCrc, crc);
75 } finally {
76 decoder.close();
77 }
78 }
79 }
80}

Callers 1

runTestMethod · 0.95

Calls 8

getBundleMethod · 0.95
readEntryMethod · 0.95
compressMethod · 0.95
fingerprintStreamMethod · 0.95
closeMethod · 0.95
setWindowMethod · 0.80
setQualityMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected