Package org.brotli.wrapper.enc
Class BrotliEncoderChannel
java.lang.Object
org.brotli.wrapper.enc.Encoder
org.brotli.wrapper.enc.BrotliEncoderChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,WritableByteChannel
WritableByteChannel that wraps native brotli encoder.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.brotli.wrapper.enc.Encoder
Encoder.Mode, Encoder.Parameters -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe default internal buffer size used by the decoder.private final ObjectFields inherited from class org.brotli.wrapper.enc.Encoder
closed, inputBuffer -
Constructor Summary
ConstructorsConstructorDescriptionBrotliEncoderChannel(WritableByteChannel destination) BrotliEncoderChannel(WritableByteChannel destination, Encoder.Parameters params) BrotliEncoderChannel(WritableByteChannel destination, Encoder.Parameters params, int bufferSize) Creates a BrotliEncoderChannel. -
Method Summary
Modifier and TypeMethodDescriptionvoidattachDictionary(PreparedDictionary dictionary) voidclose()booleanisOpen()intwrite(ByteBuffer src) Methods inherited from class org.brotli.wrapper.enc.Encoder
compress, compress, encode, flush, prepareDictionary, pushOutput
-
Field Details
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZEThe default internal buffer size used by the decoder.- See Also:
-
mutex
-
-
Constructor Details
-
BrotliEncoderChannel
public BrotliEncoderChannel(WritableByteChannel destination, Encoder.Parameters params, int bufferSize) throws IOException Creates a BrotliEncoderChannel.- Parameters:
destination- underlying destinationparams- encoding settingsbufferSize- intermediate buffer size- Throws:
IOException
-
BrotliEncoderChannel
public BrotliEncoderChannel(WritableByteChannel destination, Encoder.Parameters params) throws IOException - Throws:
IOException
-
BrotliEncoderChannel
- Throws:
IOException
-
-
Method Details
-
attachDictionary
- Overrides:
attachDictionaryin classEncoder- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-