Top Description Fields Constructors Methods
io.netty.handler.codec.compression

pack-priv final Class Bzip2MTFAndRLE2StageEncoder

extends Object
Class Inheritance
Static Imports
io.netty.handler.codec.compression.Bzip2Constants.HUFFMAN_MAX_ALPHABET_SIZE, .Bzip2Constants.HUFFMAN_SYMBOL_RUNA, .Bzip2Constants.HUFFMAN_SYMBOL_RUNB

An encoder for the Bzip2 Move To Front Transform and Run-Length Encoding[2] stages.
Although conceptually these two stages are separate, it is computationally efficient to perform them in one pass.

Field Summary

Modifier and TypeField and Description
private int
alphabetSize

The encoded alphabet size.

private final int[]
bwtBlock

The Burrows-Wheeler transformed block.

private final int
bwtLength

Actual length of the data in the bwtBlock array.

private final boolean[]
bwtValuesPresent

At each position, true if the byte value with that index is present within the block, otherwise false.

private final char[]
mtfBlock

The output of the Move To Front Transform and Run-Length Encoding[2] stages.

private int
mtfLength

The actual number of values contained in the mtfBlock array.

private final int[]
mtfSymbolFrequencies

The global frequencies of values within the mtfBlock array.

Constructor Summary

AccessConstructor and Description
pack-priv
Bzip2MTFAndRLE2StageEncoder(final int[]
The Burrows Wheeler Transformed block data
bwtBlock
,
final int
The actual length of the BWT data
bwtLength
,
final boolean[]
The values that are present within the BWT data. For each index, true if that value is present within the data, otherwise false
bwtValuesPresent
)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
encode()

Performs the Move To Front transform and Run Length Encoding[1] stages.

pack-priv int

Returns:

The size of the MTF block's alphabet
mtfAlphabetSize
()

pack-priv char[]

Returns:

The encoded MTF block
mtfBlock
()

pack-priv int

Returns:

The actual length of the MTF block
mtfLength
()

pack-priv int[]

Returns:

The frequencies of the MTF block's symbols
mtfSymbolFrequencies
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alphabetSizeback to summary
private int alphabetSize

The encoded alphabet size.

bwtBlockback to summary
private final int[] bwtBlock

The Burrows-Wheeler transformed block.

bwtLengthback to summary
private final int bwtLength

Actual length of the data in the bwtBlock array.

bwtValuesPresentback to summary
private final boolean[] bwtValuesPresent

At each position, true if the byte value with that index is present within the block, otherwise false.

mtfBlockback to summary
private final char[] mtfBlock

The output of the Move To Front Transform and Run-Length Encoding[2] stages.

mtfLengthback to summary
private int mtfLength

The actual number of values contained in the mtfBlock array.

mtfSymbolFrequenciesback to summary
private final int[] mtfSymbolFrequencies

The global frequencies of values within the mtfBlock array.

Constructor Detail

Bzip2MTFAndRLE2StageEncoderback to summary
pack-priv Bzip2MTFAndRLE2StageEncoder(final int[] bwtBlock, final int bwtLength, final boolean[] bwtValuesPresent)
Parameters
bwtBlock:int[]

The Burrows Wheeler Transformed block data

bwtLength:int

The actual length of the BWT data

bwtValuesPresent:boolean[]

The values that are present within the BWT data. For each index, true if that value is present within the data, otherwise false

Method Detail

encodeback to summary
pack-priv void encode()

Performs the Move To Front transform and Run Length Encoding[1] stages.

mtfAlphabetSizeback to summary
pack-priv int mtfAlphabetSize()
Returns:int

The size of the MTF block's alphabet

mtfBlockback to summary
pack-priv char[] mtfBlock()
Returns:char[]

The encoded MTF block

mtfLengthback to summary
pack-priv int mtfLength()
Returns:int

The actual length of the MTF block

mtfSymbolFrequenciesback to summary
pack-priv int[] mtfSymbolFrequencies()
Returns:int[]

The frequencies of the MTF block's symbols