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 int
The default internal buffer size used by the decoder.private final Object
Fields 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 TypeMethodDescriptionvoid
attachDictionary
(PreparedDictionary dictionary) void
close()
boolean
isOpen()
int
write
(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:
attachDictionary
in classEncoder
- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classEncoder
- Throws:
IOException
-
write
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-