Class BrotliEncoder.Writer
java.lang.Object
io.netty.handler.codec.compression.BrotliEncoder.Writer
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.WritableByteChannel
- Enclosing class:
BrotliEncoder
private static final class BrotliEncoder.Writer
extends java.lang.Object
implements java.nio.channels.WritableByteChannel
BrotliEncoder.Writer is the implementation of WritableByteChannel which encodes
Brotli data and stores it into ByteBuf.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.aayushatharva.brotli4j.encoder.BrotliEncoderChannelprivate final ChannelPromiseprivate booleanprivate final ChannelHandlerContextprivate booleanprivate ByteBuf -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateWriter(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters, ChannelHandlerContext ctx) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
writableBuffer
-
brotliEncoderChannel
private final com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel brotliEncoderChannel -
ctx
-
closeFuture
-
closeInitiated
private boolean closeInitiated -
isClosed
private boolean isClosed
-
-
Constructor Details
-
Writer
private Writer(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters, ChannelHandlerContext ctx) throws java.io.IOException - Throws:
java.io.IOException
-
-
Method Details
-
encode
- Throws:
java.lang.Exception
-
allocate
private void allocate(boolean preferDirect) -
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException - Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable
-
finish
- Throws:
java.io.IOException
-