Class BrotliDecompressor
java.lang.Object
io.netty.handler.codec.compression.BrotliDecompressor
- All Implemented Interfaces:
Decompressor,java.lang.AutoCloseable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.netty.handler.codec.compression.Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufAllocatorprivate com.aayushatharva.brotli4j.decoder.DecoderJNI.Wrapperprivate booleanprivate ByteBuf -
Constructor Summary
ConstructorsConstructorDescriptionBrotliDecompressor(BrotliDecompressor.Builder builder, ByteBufAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new input buffer.private voidaddSomeInput(ByteBuf buf) static BrotliDecompressor.Builderbuilder()voidclose()Close this decompressor, cleaning up any associated resources.voidNotify the decompressor that the end of input has been reached.private voidpush(int length) private static intstatus()Get the current status.Take a decompressed buffer from this decompressor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
allocator
-
decoder
private com.aayushatharva.brotli4j.decoder.DecoderJNI.Wrapper decoder -
unusedInput
-
pulledSinceLastPush
private boolean pulledSinceLastPush
-
-
Constructor Details
-
BrotliDecompressor
BrotliDecompressor(BrotliDecompressor.Builder builder, ByteBufAllocator allocator) throws DecompressionException - Throws:
DecompressionException
-
-
Method Details
-
status
Description copied from interface:DecompressorGet the current status. Like the other operations on this class, calling this method is not permitted if the decompressor has failed or was closed.- Specified by:
statusin interfaceDecompressor- Returns:
- The current status
- Throws:
DecompressionException
-
addInput
Description copied from interface:DecompressorAdd a new input buffer. Only permitted forDecompressor.Status.NEED_INPUT.- Specified by:
addInputin interfaceDecompressor- Parameters:
buf- The input buffer. Buffer ownership transfers to the decompressor (also on exception).- Throws:
DecompressionException
-
addSomeInput
-
push
private void push(int length) -
endOfInput
Description copied from interface:DecompressorNotify the decompressor that the end of input has been reached. Some implementations may flush remaining data or throw an exception if the input is truncated, but most implementations do nothing. Only permitted forDecompressor.Status.NEED_INPUT.- Specified by:
endOfInputin interfaceDecompressor- Throws:
DecompressionException
-
takeOutput
Description copied from interface:DecompressorTake a decompressed buffer from this decompressor. Only permitted forDecompressor.Status.NEED_OUTPUT. Buffer ownership transfers to the caller.- Specified by:
takeOutputin interfaceDecompressor- Returns:
- The decompressed buffer. May be empty.
- Throws:
DecompressionException
-
close
public void close()Description copied from interface:DecompressorClose this decompressor, cleaning up any associated resources. This method is idempotent.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceDecompressor
-
readBytes
-
builder
-