Class BrotliEncoderChannel
- java.lang.Object
-
- com.aayushatharva.brotli4j.encoder.Encoder
-
- com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.WritableByteChannel
public class BrotliEncoderChannel extends Encoder implements java.nio.channels.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
Constructors Constructor Description BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination)Creates a BrotliEncoderChannelBrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params)Creates a BrotliEncoderChannelBrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params, int bufferSize)Creates a BrotliEncoderChannel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachDictionary(PreparedDictionary dictionary)voidclose()booleanisOpen()intwrite(java.nio.ByteBuffer src)-
Methods inherited from class com.aayushatharva.brotli4j.encoder.Encoder
compress, compress, prepareDictionary
-
-
-
-
Constructor Detail
-
BrotliEncoderChannel
public BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params, int bufferSize) throws java.io.IOExceptionCreates a BrotliEncoderChannel- Parameters:
destination- underlying destinationparams- encoding settingsbufferSize- intermediate buffer size- Throws:
java.io.IOException- If any failure during initialization
-
BrotliEncoderChannel
public BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params) throws java.io.IOExceptionCreates a BrotliEncoderChannel- Parameters:
destination- underlying destinationparams- encoding settings- Throws:
java.io.IOException- If any failure during initialization
-
BrotliEncoderChannel
public BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination) throws java.io.IOExceptionCreates a BrotliEncoderChannel- Parameters:
destination- underlying destination- Throws:
java.io.IOException- If any failure during initialization
-
-
Method Detail
-
attachDictionary
public void attachDictionary(PreparedDictionary dictionary) throws java.io.IOException
- Overrides:
attachDictionaryin classEncoder- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
-