Class Encoder
java.lang.Object
com.aayushatharva.brotli4j.encoder.Encoder
- Direct Known Subclasses:
BrotliEncoderChannel
Base class for OutputStream / Channel implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumhttps://www.brotli.org/encode.html#aa6f See encode.h, typedef enum BrotliEncoderMode Important: The ordinal value of the modes should be the same as the constant values in encode.hstatic final classBrotli encoder settings. -
Method Summary
Modifier and TypeMethodDescriptionvoidattachDictionary(PreparedDictionary dictionary) static byte[]compress(byte[] data) static byte[]compress(byte[] data, Encoder.Parameters params) Encodes the given data buffer.static PreparedDictionaryprepareDictionary(ByteBuffer dictionary, int sharedDictionaryType) Prepares raw or serialized dictionary for being used by encoder.
-
Method Details
-
compress
Encodes the given data buffer.- Parameters:
data- byte array to be compressedparams-Encoder.Parametersinstance- Returns:
- compressed byte array
- Throws:
IOException- If any failure during encoding
-
compress
- Throws:
IOException
-
prepareDictionary
Prepares raw or serialized dictionary for being used by encoder.- Parameters:
dictionary- raw / serialized dictionary data; MUST be directsharedDictionaryType- dictionary data type- Returns:
PreparedDictionaryinstance
-
attachDictionary
- Throws:
IOException
-