Package org.brotli.integration
Class BundleHelper
- java.lang.Object
-
- org.brotli.integration.BundleHelper
-
public class BundleHelper extends java.lang.Object
Utilities to work test files bundles in zip archive.
-
-
Field Summary
Fields Modifier and Type Field Description private static long
CRC_64_POLY
ECMA CRC64 polynomial.
-
Constructor Summary
Constructors Modifier Constructor Description private
BundleHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
fingerprintStream(java.io.InputStream input)
Calculates CRC64 of stream contents.static long
getExpectedFingerprint(java.lang.String entryName)
static java.util.List<java.lang.String>
listEntries(java.io.InputStream input)
static byte[]
readEntry(java.io.InputStream input, java.lang.String entryName)
static byte[]
readStream(java.io.InputStream input)
static long
updateCrc64(long crc, byte[] data, int offset, int length)
Rolls CRC64 calculation.
-
-
-
Method Detail
-
listEntries
public static java.util.List<java.lang.String> listEntries(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
readStream
public static byte[] readStream(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
readEntry
public static byte[] readEntry(java.io.InputStream input, java.lang.String entryName) throws java.io.IOException
- Throws:
java.io.IOException
-
updateCrc64
public static long updateCrc64(long crc, byte[] data, int offset, int length)
Rolls CRC64 calculation.CRC64(data) = -1 ^ updateCrc64((... updateCrc64(-1, firstBlock), ...), lastBlock);
This simple and reliable checksum is chosen to make is easy to calculate the same value across the variety of languages (C++, Java, Go, ...).
-
fingerprintStream
public static long fingerprintStream(java.io.InputStream input) throws java.io.IOException
Calculates CRC64 of stream contents.- Throws:
java.io.IOException
-
getExpectedFingerprint
public static long getExpectedFingerprint(java.lang.String entryName)
-
-