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

Method fingerprintStream

java/org/brotli/integration/BundleHelper.java:95–106  ·  view source on GitHub ↗

Calculates CRC64 of stream contents.

(InputStream input)

Source from the content-addressed store, hash-verified

93 * Calculates CRC64 of stream contents.
94 */
95 public static long fingerprintStream(InputStream input) throws IOException {
96 byte[] buffer = new byte[65536];
97 long crc = -1;
98 while (true) {
99 int len = input.read(buffer);
100 if (len <= 0) {
101 break;
102 }
103 crc = updateCrc64(crc, buffer, 0, len);
104 }
105 return ~crc;
106 }
107
108 public static long getExpectedFingerprint(String entryName) {
109 int dotIndex = entryName.indexOf('.');

Callers 8

runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95

Calls 2

updateCrc64Method · 0.95
readMethod · 0.45

Tested by 7

runMethod · 0.76
runMethod · 0.76
runMethod · 0.76
runMethod · 0.76
runMethod · 0.76
runMethod · 0.76
runMethod · 0.76