Class BundleHelper

java.lang.Object
org.brotli.integration.BundleHelper

public class BundleHelper extends Object
Utilities to work test files bundles in zip archive.
  • Field Details

    • CRC_64_POLY

      private static final long CRC_64_POLY
      ECMA CRC64 polynomial.
  • Constructor Details

    • BundleHelper

      private BundleHelper()
  • Method Details

    • listEntries

      public static List<String> listEntries(InputStream input) throws IOException
      Throws:
      IOException
    • readStream

      public static byte[] readStream(InputStream input) throws IOException
      Throws:
      IOException
    • readEntry

      public static byte[] readEntry(InputStream input, String entryName) throws IOException
      Throws:
      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(InputStream input) throws IOException
      Calculates CRC64 of stream contents.
      Throws:
      IOException
    • getExpectedFingerprint

      public static long getExpectedFingerprint(String entryName)