Class BrotliCommon
java.lang.Object
com.aayushatharva.brotli4j.common.BrotliCommon
JNI wrapper for brotli common.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckDictionaryDataMd5(byte[] digest) Checks if the given checksum matches MD5 checksum of the RFC dictionary.static booleancheckDictionaryDataSha1(byte[] digest) Checks if the given checksum matches SHA-1 checksum of the RFC dictionary.static booleancheckDictionaryDataSha256(byte[] digest) Checks if the given checksum matches SHA-256 checksum of the RFC dictionary.static ByteBuffermakeNative(byte[] data) Copy bytes to a new direct ByteBuffer.static voidsetDictionaryData(byte[] data) Copies data and sets it to be brotli dictionary.static voidReads data and sets it to be brotli dictionary.static voidsetDictionaryData(ByteBuffer data) Sets data to be brotli dictionary.
-
Field Details
-
RFC_DICTIONARY_SIZE
public static final int RFC_DICTIONARY_SIZE- See Also:
-
-
Constructor Details
-
BrotliCommon
public BrotliCommon()
-
-
Method Details
-
checkDictionaryDataMd5
public static boolean checkDictionaryDataMd5(byte[] digest) Checks if the given checksum matches MD5 checksum of the RFC dictionary.- Parameters:
digest- digest byte array- Returns:
trueif check was successful elsefalse
-
checkDictionaryDataSha1
public static boolean checkDictionaryDataSha1(byte[] digest) Checks if the given checksum matches SHA-1 checksum of the RFC dictionary.- Parameters:
digest- digest byte array- Returns:
trueif check was successful elsefalse
-
checkDictionaryDataSha256
public static boolean checkDictionaryDataSha256(byte[] digest) Checks if the given checksum matches SHA-256 checksum of the RFC dictionary.- Parameters:
digest- digest byte array- Returns:
trueif check was successful elsefalse
-
makeNative
Copy bytes to a new direct ByteBuffer.Direct byte buffers are used to supply native code with large data chunks.
- Parameters:
data- byte array of data- Returns:
ByteBufferinstance
-
setDictionaryData
public static void setDictionaryData(byte[] data) Copies data and sets it to be brotli dictionary.- Parameters:
data- byte array of data
-
setDictionaryData
Reads data and sets it to be brotli dictionary.- Parameters:
src-InputStreamof dictionary data- Throws:
IOException- In case of error during processing dictionary
-
setDictionaryData
Sets data to be brotli dictionary.- Parameters:
data-ByteBufferdictionary data
-