Calculates CRC64 of stream contents.
(InputStream input)
| 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('.'); |