Class Utils
java.lang.Object
org.brotli.dec.Utils
A set of utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static ByteBuffer(package private) static voidcloseInput(State s) (package private) static voidcopyBytes(byte[] dst, int target, byte[] src, int start, int end) (package private) static voidcopyBytesWithin(byte[] bytes, int target, int start, int end) (package private) static voidfillBytesWithZeroes(byte[] dest, int start, int end) Fills byte array with zeroes.(package private) static voidfillIntsWithZeroes(int[] dest, int start, int end) Fills int array with zeroes.(package private) static voidflipBuffer(Buffer buffer) (package private) static int(package private) static int(package private) static intisDirect(ByteBuffer src) (package private) static intisReadOnly(ByteBuffer src) (package private) static InputStream(package private) static int(package private) static intmin(int a, int b) (package private) static int(package private) static intshr32(int x, int y) (package private) static longshr64(long x, int y) (package private) static byte[]toUsAsciiBytes(String src) (package private) static int[]toUtf8Runes(String src)
-
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(Object, int, Object, int, int), so it should be used for length not less than 16.- Parameters:
dest- array to fill with zeroesstart- the first item to fillend- the last item to fill (exclusive)
-
fillIntsWithZeroes
static void fillIntsWithZeroes(int[] dest, int start, int end) Fills int array with zeroes.Current implementation uses
System.arraycopy(Object, int, Object, int, int), so it should be used for length not less than 16.- Parameters:
dest- array to fill with zeroesstart- the first item to fillend- the last item to fill (exclusive)
-
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
-
makeEmptyInput
-
closeInput
- Throws:
IOException
-
toUsAsciiBytes
-
toUtf8Runes
-
asReadOnlyBuffer
-
isReadOnly
-
isDirect
-
flipBuffer
-
isDebugMode
static int isDebugMode() -
getLogBintness
static int getLogBintness() -
shr32
static int shr32(int x, int y) -
shr64
static long shr64(long x, int y) -
min
static int min(int a, int b) -
makeError
-