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.WritableByteChannelBrotliEncoder.Writeris the implementation ofWritableByteChannelwhich encodes Brotli data and stores it intoByteBuf.
-
-
Field Summary
Fields Modifier and Type Field Description private com.aayushatharva.brotli4j.encoder.BrotliEncoderChannelbrotliEncoderChannelprivate booleancloseInitiatedprivate ChannelHandlerContextctxprivate booleanisClosedprivate ByteBufwritableBuffer
-
Constructor Summary
Constructors Modifier Constructor Description privateWriter(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters, ChannelHandlerContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidallocate(boolean preferDirect)voidclose()private voidencode(ByteBuf msg, boolean preferDirect)voidfinish(ChannelPromise promise)booleanisOpen()intwrite(java.nio.ByteBuffer src)
-
-
-
Field Detail
-
writableBuffer
private ByteBuf writableBuffer
-
brotliEncoderChannel
private final com.aayushatharva.brotli4j.encoder.BrotliEncoderChannel brotliEncoderChannel
-
ctx
private final ChannelHandlerContext ctx
-
closeInitiated
private boolean closeInitiated
-
isClosed
private boolean isClosed
-
-
Constructor Detail
-
Writer
private Writer(com.aayushatharva.brotli4j.encoder.Encoder.Parameters parameters, ChannelHandlerContext ctx) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
encode
private void encode(ByteBuf msg, boolean preferDirect) throws java.lang.Exception
- 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
public void finish(ChannelPromise promise) throws java.io.IOException
- Throws:
java.io.IOException
-
-