Package org.brotli.wrapper.enc
Class BrotliEncoderChannel
- java.lang.Object
-
- org.brotli.wrapper.enc.Encoder
-
- org.brotli.wrapper.enc.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 org.brotli.wrapper.enc.Encoder
Encoder.Mode, Encoder.Parameters
-
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_BUFFER_SIZEThe default internal buffer size used by the decoder.private java.lang.Objectmutex-
Fields inherited from class org.brotli.wrapper.enc.Encoder
closed, inputBuffer
-
-
Constructor Summary
Constructors Constructor Description BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination)BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params)BrotliEncoderChannel(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 org.brotli.wrapper.enc.Encoder
compress, compress, encode, flush, prepareDictionary, pushOutput
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE
The default internal buffer size used by the decoder.- See Also:
- Constant Field Values
-
mutex
private final java.lang.Object mutex
-
-
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
-
BrotliEncoderChannel
public BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination, Encoder.Parameters params) throws java.io.IOException- Throws:
java.io.IOException
-
BrotliEncoderChannel
public BrotliEncoderChannel(java.nio.channels.WritableByteChannel destination) throws java.io.IOException- Throws:
java.io.IOException
-
-
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
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
-