Package org.brotli.dec
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 void
closeInput
(InputStream src) (package private) static void
copyBytes
(byte[] dst, int target, byte[] src, int start, int end) (package private) static void
copyBytesWithin
(byte[] bytes, int target, int start, int end) (package private) static void
fillBytesWithZeroes
(byte[] dest, int start, int end) Fills byte array with zeroes.(package private) static void
fillIntsWithZeroes
(int[] dest, int start, int end) Fills int array with zeroes.(package private) static void
flipBuffer
(Buffer buffer) (package private) static int
(package private) static int
(package private) static int
isDirect
(ByteBuffer src) (package private) static int
isReadOnly
(ByteBuffer src) (package private) static int
readInput
(InputStream src, byte[] dst, int offset, int length) (package private) static byte[]
toUsAsciiBytes
(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(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 zeroesoffset
- the first byte to filllength
- 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 zeroesoffset
- the first item to filllength
- 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
-
closeInput
- Throws:
IOException
-
toUsAsciiBytes
-
asReadOnlyBuffer
-
isReadOnly
-
isDirect
-
flipBuffer
-
isDebugMode
static int isDebugMode() -
getLogBintness
static int getLogBintness()
-