Package org.brotli.dec
Class Utils
- java.lang.Object
-
- org.brotli.dec.Utils
-
final class Utils extends java.lang.Object
A set of utility methods.
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
BYTE_ZEROES
private static int[]
INT_ZEROES
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static java.nio.ByteBuffer
asReadOnlyBuffer(java.nio.ByteBuffer src)
(package private) static void
closeInput(java.io.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(java.nio.Buffer buffer)
(package private) static int
getLogBintness()
(package private) static int
isDebugMode()
(package private) static int
isDirect(java.nio.ByteBuffer src)
(package private) static int
isReadOnly(java.nio.ByteBuffer src)
(package private) static int
readInput(java.io.InputStream src, byte[] dst, int offset, int length)
(package private) static byte[]
toUsAsciiBytes(java.lang.String src)
-
-
-
Method Detail
-
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
static int readInput(java.io.InputStream src, byte[] dst, int offset, int length)
-
closeInput
static void closeInput(java.io.InputStream src) throws java.io.IOException
- Throws:
java.io.IOException
-
toUsAsciiBytes
static byte[] toUsAsciiBytes(java.lang.String src)
-
asReadOnlyBuffer
static java.nio.ByteBuffer asReadOnlyBuffer(java.nio.ByteBuffer src)
-
isReadOnly
static int isReadOnly(java.nio.ByteBuffer src)
-
isDirect
static int isDirect(java.nio.ByteBuffer src)
-
flipBuffer
static void flipBuffer(java.nio.Buffer buffer)
-
isDebugMode
static int isDebugMode()
-
getLogBintness
static int getLogBintness()
-
-