Top Description Fields Constructors Methods
com.aayushatharva.brotli4j.common

public Class BrotliCommon

extends Object
Class Inheritance
Annotations
@Upstream
Imports
com.aayushatharva.brotli4j.common.annotations.Upstream, java.io.IOException, .InputStream, java.nio.ByteBuffer, java.util.Arrays

JNI wrapper for brotli common.

Field Summary

Modifier and TypeField and Description
private static boolean
private static final Object
private static final byte[]
private static final byte[]
private static final byte[]
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if check was successful else false
checkDictionaryDataMd5
(byte[]
digest byte array
digest
)

Checks if the given checksum matches MD5 checksum of the RFC dictionary.

public static boolean

Returns:

true if check was successful else false
checkDictionaryDataSha1
(byte[]
digest byte array
digest
)

Checks if the given checksum matches SHA-1 checksum of the RFC dictionary.

public static boolean

Returns:

true if check was successful else false
checkDictionaryDataSha256
(byte[]
digest byte array
digest
)

Checks if the given checksum matches SHA-256 checksum of the RFC dictionary.

public static ByteBuffer

Returns:

ByteBuffer instance
makeNative
(byte[]
byte array of data
data
)

Copy bytes to a new direct ByteBuffer.

public static void
setDictionaryData(byte[]
byte array of data
data
)

Copies data and sets it to be brotli dictionary.

public static void
setDictionaryData(InputStream
InputStream of dictionary data
src
)

Reads data and sets it to be brotli dictionary.

public static void
setDictionaryData(ByteBuffer
ByteBuffer dictionary data
data
)

Sets data to be brotli dictionary.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isDictionaryDataSetback to summary
private static boolean isDictionaryDataSet
mutexback to summary
private static final Object mutex
RFC_DICTIONARY_MD5back to summary
private static final byte[] RFC_DICTIONARY_MD5
RFC_DICTIONARY_SHA_1back to summary
private static final byte[] RFC_DICTIONARY_SHA_1
RFC_DICTIONARY_SHA_256back to summary
private static final byte[] RFC_DICTIONARY_SHA_256
RFC_DICTIONARY_SIZEback to summary
public static final int RFC_DICTIONARY_SIZE

Constructor Detail

BrotliCommonback to summary
public BrotliCommon()

Method Detail

checkDictionaryDataMd5back to summary
public static boolean checkDictionaryDataMd5(byte[] digest)

Checks if the given checksum matches MD5 checksum of the RFC dictionary.

Parameters
digest:byte[]

digest byte array

Returns:boolean

true if check was successful else false

checkDictionaryDataSha1back to summary
public static boolean checkDictionaryDataSha1(byte[] digest)

Checks if the given checksum matches SHA-1 checksum of the RFC dictionary.

Parameters
digest:byte[]

digest byte array

Returns:boolean

true if check was successful else false

checkDictionaryDataSha256back to summary
public static boolean checkDictionaryDataSha256(byte[] digest)

Checks if the given checksum matches SHA-256 checksum of the RFC dictionary.

Parameters
digest:byte[]

digest byte array

Returns:boolean

true if check was successful else false

makeNativeback to summary
public static ByteBuffer makeNative(byte[] data)

Copy bytes to a new direct ByteBuffer.

Direct byte buffers are used to supply native code with large data chunks.

Parameters
data:byte[]

byte array of data

Returns:ByteBuffer

ByteBuffer instance

setDictionaryDataback to summary
public static void setDictionaryData(byte[] data)

Copies data and sets it to be brotli dictionary.

Parameters
data:byte[]

byte array of data

setDictionaryDataback to summary
public static void setDictionaryData(InputStream src) throws IOException

Reads data and sets it to be brotli dictionary.

Parameters
src:InputStream

InputStream of dictionary data

Exceptions
IOException:
In case of error during processing dictionary
setDictionaryDataback to summary
public static void setDictionaryData(ByteBuffer data)

Sets data to be brotli dictionary.

Parameters
data:ByteBuffer

ByteBuffer dictionary data