Package org.brotli.wrapper.enc
Class Encoder
java.lang.Object
org.brotli.wrapper.enc.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. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer(package private) booleanprivate final WritableByteChannelprivate final List<PreparedDictionary> private final EncoderJNI.Wrapper(package private) final ByteBuffer -
Constructor Summary
ConstructorsConstructorDescriptionEncoder(WritableByteChannel destination, Encoder.Parameters params, int inputBufferSize) Creates a Encoder wrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidattachDictionary(PreparedDictionary dictionary) (package private) voidclose()static byte[]compress(byte[] data) static byte[]compress(byte[] data, Encoder.Parameters params) Encodes the given data buffer.(package private) booleanprivate void(package private) voidflush()static PreparedDictionaryprepareDictionary(ByteBuffer dictionary, int sharedDictionaryType) Prepares raw or serialized dictionary for being used by encoder.(package private) booleanpushOutput(boolean force)
-
Field Details
-
destination
-
dictionaries
-
encoder
-
buffer
-
inputBuffer
-
closed
boolean closed
-
-
Constructor Details
-
Encoder
Encoder(WritableByteChannel destination, Encoder.Parameters params, int inputBufferSize) throws IOException Creates a Encoder wrapper.- Parameters:
destination- underlying destinationparams- encoding parametersinputBufferSize- read buffer size- Throws:
IOException
-
-
Method Details
-
fail
- Throws:
IOException
-
attachDictionary
- Throws:
IOException
-
pushOutput
- Parameters:
force- repeat pushing until all output is consumed- Returns:
- true if all encoder output is consumed
- Throws:
IOException
-
encode
- Returns:
- true if there is space in inputBuffer.
- Throws:
IOException
-
flush
- Throws:
IOException
-
close
- Throws:
IOException
-
compress
Encodes the given data buffer.- Throws:
IOException
-
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
-