org.apache.commons.compress.compressors.bzip2

Class BZip2OutputStream

public class BZip2OutputStream extends OutputStream implements BZip2Constants

An output stream that compresses into the BZip2 format (without the file header chars) into another stream. TODO: Update to BZip2 1.0.1

Author: Keiron Liddle

Nested Class Summary
static classBZip2OutputStream.StackElem
Field Summary
static intCLEARMASK
static intDEPTH_THRESH
static intGREATER_ICOST
static intLESSER_ICOST
static intLOWER_BYTE_MASK
intm_allowableBlockSize
char[]m_block
intm_blockCRC
booleanm_blockRandomised
intm_blockSize100k
intm_bsBuff
intm_bsLive
OutputStreamm_bsStream
booleanm_closed
intm_combinedCRC
CRCm_crc
intm_currentChar
booleanm_firstAttempt
int[]m_ftab
int[]m_incs
boolean[]m_inUse
intm_last
int[]m_mtfFreq
intm_nInUse
intm_nMTF
intm_origPtr
int[]m_quadrant
intm_runLength
char[]m_selector
char[]m_selectorMtf
char[]m_seqToUnseq
short[]m_szptr
char[]m_unseqToSeq
intm_workDone
intm_workFactor
intm_workLimit
int[]m_zptr
static intQSORT_STACK_SIZE
static intSETMASK
static intSMALL_THRESH
static intUPPER_BYTE_MASK
Constructor Summary
BZip2OutputStream(OutputStream output)
BZip2OutputStream(OutputStream output, int blockSize)
Method Summary
voidallocateCompressStructures()
voidbsFinishedWithStream()
voidbsPutint(int u)
voidbsPutIntVS(int numBits, int c)
voidbsPutUChar(int c)
voidbsSetStream(OutputStream f)
voidbsW(int n, int v)
static intcalculateWeight(int v1, int v2)
voidclose()
voiddoReversibleTransformation()
voidendBlock()
voidendCompression()
voidfinalize()
voidflush()
booleanfullGtU(int i1, int i2)
voidgenerateMTFValues()
voidhbAssignCodes(int[] code, char[] length, int minLen, int maxLen, int alphaSize)
static voidhbMakeCodeLengths(char[] len, int[] freq, int alphaSize, int maxLen)
voidinitBlock()
voidinitialize()
voidmainSort()
voidmakeMaps()
charmed3(char a, char b, char c)
voidmoveToFrontCodeAndSend()
static voidpanic()
voidqSort3(int loSt, int hiSt, int dSt)
voidrandomiseBlock()
voidsendMTFValues()
voidsimpleSort(int lo, int hi, int d)
voidvswap(int p1, int p2, int n)
voidwrite(int bv)
modified by Oliver Merkel, 010128
voidwriteRun()

Field Detail

CLEARMASK

private static final int CLEARMASK

DEPTH_THRESH

private static final int DEPTH_THRESH

GREATER_ICOST

private static final int GREATER_ICOST

LESSER_ICOST

private static final int LESSER_ICOST

LOWER_BYTE_MASK

private static final int LOWER_BYTE_MASK

m_allowableBlockSize

private int m_allowableBlockSize

m_block

private char[] m_block

m_blockCRC

private int m_blockCRC

m_blockRandomised

private boolean m_blockRandomised

m_blockSize100k

private int m_blockSize100k

m_bsBuff

private int m_bsBuff

m_bsLive

private int m_bsLive

m_bsStream

private OutputStream m_bsStream

m_closed

private boolean m_closed

m_combinedCRC

private int m_combinedCRC

m_crc

private CRC m_crc

m_currentChar

private int m_currentChar

m_firstAttempt

private boolean m_firstAttempt

m_ftab

private int[] m_ftab

m_incs

private int[] m_incs

m_inUse

private boolean[] m_inUse

m_last

private int m_last

m_mtfFreq

private int[] m_mtfFreq

m_nInUse

private int m_nInUse

m_nMTF

private int m_nMTF

m_origPtr

private int m_origPtr

m_quadrant

private int[] m_quadrant

m_runLength

private int m_runLength

m_selector

private char[] m_selector

m_selectorMtf

private char[] m_selectorMtf

m_seqToUnseq

private char[] m_seqToUnseq

m_szptr

private short[] m_szptr

m_unseqToSeq

private char[] m_unseqToSeq

m_workDone

private int m_workDone

m_workFactor

private int m_workFactor

m_workLimit

private int m_workLimit

m_zptr

private int[] m_zptr

QSORT_STACK_SIZE

private static final int QSORT_STACK_SIZE

SETMASK

private static final int SETMASK

SMALL_THRESH

private static final int SMALL_THRESH

UPPER_BYTE_MASK

private static final int UPPER_BYTE_MASK

Constructor Detail

BZip2OutputStream

public BZip2OutputStream(OutputStream output)

BZip2OutputStream

public BZip2OutputStream(OutputStream output, int blockSize)

Method Detail

allocateCompressStructures

private void allocateCompressStructures()

bsFinishedWithStream

private void bsFinishedWithStream()

bsPutint

private void bsPutint(int u)

bsPutIntVS

private void bsPutIntVS(int numBits, int c)

bsPutUChar

private void bsPutUChar(int c)

bsSetStream

private void bsSetStream(OutputStream f)

bsW

private void bsW(int n, int v)

calculateWeight

private static int calculateWeight(int v1, int v2)

close

public void close()

doReversibleTransformation

private void doReversibleTransformation()

endBlock

private void endBlock()

endCompression

private void endCompression()

finalize

public void finalize()

flush

public void flush()

fullGtU

private boolean fullGtU(int i1, int i2)

generateMTFValues

private void generateMTFValues()

hbAssignCodes

private void hbAssignCodes(int[] code, char[] length, int minLen, int maxLen, int alphaSize)

hbMakeCodeLengths

private static void hbMakeCodeLengths(char[] len, int[] freq, int alphaSize, int maxLen)

initBlock

private void initBlock()

initialize

private void initialize()

mainSort

private void mainSort()

makeMaps

private void makeMaps()

med3

private char med3(char a, char b, char c)

moveToFrontCodeAndSend

private void moveToFrontCodeAndSend()

panic

private static void panic()

qSort3

private void qSort3(int loSt, int hiSt, int dSt)

randomiseBlock

private void randomiseBlock()

sendMTFValues

private void sendMTFValues()

simpleSort

private void simpleSort(int lo, int hi, int d)

vswap

private void vswap(int p1, int p2, int n)

write

public void write(int bv)
modified by Oliver Merkel, 010128

Parameters: bv Description of Parameter

Throws: java.io.IOException Description of Exception

writeRun

private void writeRun()