Class Utils

java.lang.Object
org.brotli.dec.Utils

final class Utils extends Object
A set of utility methods.
  • Field Details

    • BYTE_ZEROES

      private static final byte[] BYTE_ZEROES
    • INT_ZEROES

      private static final int[] INT_ZEROES
  • Constructor Details

    • Utils

      Utils()
  • Method Details

    • fillBytesWithZeroes

      static void fillBytesWithZeroes(byte[] dest, int start, int end)
      Fills byte array with zeroes.

      Current implementation uses System.arraycopy(java.lang.Object, int, java.lang.Object, int, int), so it should be used for length not less than 16.

      Parameters:
      dest - array to fill with zeroes
      offset - the first byte to fill
      length - number of bytes to change
    • fillIntsWithZeroes

      static void fillIntsWithZeroes(int[] dest, int start, int end)
      Fills int array with zeroes.

      Current implementation uses System.arraycopy(java.lang.Object, int, java.lang.Object, int, int), so it should be used for length not less than 16.

      Parameters:
      dest - array to fill with zeroes
      offset - the first item to fill
      length - number of item to change
    • copyBytes

      static void copyBytes(byte[] dst, int target, byte[] src, int start, int end)
    • copyBytesWithin

      static void copyBytesWithin(byte[] bytes, int target, int start, int end)
    • readInput

      static int readInput(InputStream src, byte[] dst, int offset, int length)
    • closeInput

      static void closeInput(InputStream src) throws IOException
      Throws:
      IOException
    • toUsAsciiBytes

      static byte[] toUsAsciiBytes(String src)
    • asReadOnlyBuffer

      static ByteBuffer asReadOnlyBuffer(ByteBuffer src)
    • isReadOnly

      static int isReadOnly(ByteBuffer src)
    • isDirect

      static int isDirect(ByteBuffer src)
    • flipBuffer

      static void flipBuffer(Buffer buffer)
    • isDebugMode

      static int isDebugMode()
    • getLogBintness

      static int getLogBintness()