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 enum
https://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 class
Brotli encoder settings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachDictionary
(PreparedDictionary dictionary) static byte[]
compress
(byte[] data) static byte[]
compress
(byte[] data, Encoder.Parameters params) Encodes the given data buffer.static PreparedDictionary
prepareDictionary
(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.Parameters
instance- 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:
PreparedDictionary
instance
-
attachDictionary
- Throws:
IOException
-