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 voidcloseInput(InputStream src) (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 intreadInput(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()
-