Class BrotliEncoderChannel
java.lang.Object
com.aayushatharva.brotli4j.encoder.Encoder
com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,WritableByteChannel
WritableByteChannel that wraps native brotli encoder.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.aayushatharva.brotli4j.encoder.Encoder
Encoder.Mode, Encoder.Parameters
-
Constructor Summary
ConstructorsConstructorDescriptionBrotliEncoderChannel
(WritableByteChannel destination) Creates a BrotliEncoderChannelBrotliEncoderChannel
(WritableByteChannel destination, Encoder.Parameters params) Creates a BrotliEncoderChannelBrotliEncoderChannel
(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 com.aayushatharva.brotli4j.encoder.Encoder
compress, compress, prepareDictionary
-
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
- If any failure during initialization
-
BrotliEncoderChannel
public BrotliEncoderChannel(WritableByteChannel destination, Encoder.Parameters params) throws IOException Creates a BrotliEncoderChannel- Parameters:
destination
- underlying destinationparams
- encoding settings- Throws:
IOException
- If any failure during initialization
-
BrotliEncoderChannel
Creates a BrotliEncoderChannel- Parameters:
destination
- underlying destination- Throws:
IOException
- If any failure during initialization
-
-
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
- Throws:
IOException
-
write
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-