Top Description Fields Constructors Methods
com.aayushatharva.brotli4j.decoder

public Class Decoder

extends Object
Class Inheritance
Known Direct Subclasses
com.aayushatharva.brotli4j.decoder.BrotliDecoderChannel
Annotations
@Upstream
@Local
Imports
com.aayushatharva.brotli4j.common.annotations.Local, .Upstream, java.io.IOException, java.nio.Buffer, .ByteBuffer, java.nio.channels.ReadableByteChannel, java.util.ArrayList

Base class for InputStream / Channel implementations.

Field Summary

Modifier and TypeField and Description
pack-priv ByteBuffer
pack-priv boolean
private final DecoderJNI.Wrapper
pack-priv boolean
private static final ByteBuffer
private final ReadableByteChannel

Constructor Summary

AccessConstructor and Description
public
Decoder(ReadableByteChannel
underlying source
source
,
int
read buffer size
inputBufferSize
)

Creates a Decoder wrapper.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv void
pack-priv int
pack-priv int

Returns:

-1 if stream is finished, or number of bytes available in read buffer (> 0)
decode
()

Continue decoding.

public static DirectDecompress

Returns:

DirectDecompress instance
decompress
(byte[]
byte array of data to be decoded
data
)

Decodes the given data buffer.

public static byte[]
decompress(byte[] data, int offset, int length)

Decodes the given data buffer starting at offset till length.

pack-priv void
discard(int length)

public void
private void
fail(String message)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
pack-priv ByteBuffer buffer
closedback to summary
pack-priv boolean closed
decoderback to summary
private final DecoderJNI.Wrapper decoder
eagerback to summary
pack-priv boolean eager
EMPTY_BUFFERback to summary
private static final ByteBuffer EMPTY_BUFFER
sourceback to summary
private final ReadableByteChannel source

Constructor Detail

Decoderback to summary
public Decoder(ReadableByteChannel source, int inputBufferSize) throws IOException

Creates a Decoder wrapper.

Parameters
source:ReadableByteChannel

underlying source

inputBufferSize:int

read buffer size

Exceptions
IOException:
If any failure during initialization

Method Detail

attachDictionaryback to summary
pack-priv void attachDictionary(ByteBuffer dictionary) throws IOException
Annotations
@Upstream
closeback to summary
pack-priv void close() throws IOException
Annotations
@Upstream
consumeback to summary
pack-priv int consume(ByteBuffer dst)
Annotations
@Upstream
decodeback to summary
pack-priv int decode() throws IOException

Continue decoding.

Returns:int

-1 if stream is finished, or number of bytes available in read buffer (> 0)

Annotations
@Upstream
decompressback to summary
public static DirectDecompress decompress(byte[] data) throws IOException

Decodes the given data buffer.

Parameters
data:byte[]

byte array of data to be decoded

Returns:DirectDecompress

DirectDecompress instance

Annotations
@Local
Exceptions
IOException:
If an error occurs during decoding
decompressback to summary
public static byte[] decompress(byte[] data, int offset, int length) throws IOException

Decodes the given data buffer starting at offset till length.

Annotations
@Upstream
discardback to summary
pack-priv void discard(int length)
Annotations
@Upstream
enableEagerOutputback to summary
public void enableEagerOutput()
Annotations
@Upstream
failback to summary
private void fail(String message) throws IOException
Annotations
@Upstream