org.codehaus.plexus.archiver.bzip2
Class CBZip2InputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.codehaus.plexus.archiver.bzip2.CBZip2InputStream
All Implemented Interfaces:
BZip2Constants

public class CBZip2InputStream
extends java.io.InputStream
implements BZip2Constants

An input stream that decompresses from the BZip2 format (without the file header chars) to be read as any other stream.

Version:
$Revision: 2436 $ $Date: 2005-09-01 19:20:41 +0200 (Thu, 01 Sep 2005) $ from org.apache.ant.tools.bzip2.CBZip2InputStream v1.18

Field Summary
private  int[][] base
           
private  boolean blockRandomised
           
private  int blockSize100k
           
private  int bsBuff
           
private  int bsLive
           
private  java.io.InputStream bsStream
           
private  int ch2
           
private  int chPrev
           
private  int computedCombinedCRC
           
private  int count
           
private  int currentChar
           
private  int currentState
           
private  int i
           
private  int i2
           
private  boolean[] inUse
           
private  int j2
           
private  int last
           
private  int[][] limit
           
private  char[] ll8
           
private  CRC mCrc
           
private  int[] minLens
           
private  int nInUse
           
private static int NO_RAND_PART_A_STATE
           
private static int NO_RAND_PART_B_STATE
           
private static int NO_RAND_PART_C_STATE
           
private  int origPtr
           
private  int[][] perm
           
private static int RAND_PART_A_STATE
           
private static int RAND_PART_B_STATE
           
private static int RAND_PART_C_STATE
           
private  int rNToGo
           
private  int rTPos
           
private  char[] selector
           
private  char[] selectorMtf
           
private  char[] seqToUnseq
           
private static int START_BLOCK_STATE
           
private  int storedBlockCRC
           
private  boolean streamEnd
           
private  int tPos
           
private  int[] tt
           
private  char[] unseqToSeq
           
private  int[] unzftab
           
private  char z
           
 
Fields inherited from class java.io.InputStream
 
Fields inherited from interface org.codehaus.plexus.archiver.bzip2.BZip2Constants
baseBlockSize, G_SIZE, MAX_ALPHA_SIZE, MAX_CODE_LEN, MAX_SELECTORS, N_GROUPS, N_ITERS, NUM_OVERSHOOT_BYTES, rNums, RUNA, RUNB
 
Constructor Summary
CBZip2InputStream(java.io.InputStream zStream)
           
 
Method Summary
private static void badBlockHeader()
           
private static void blockOverrun()
           
private  void bsFinishedWithStream()
           
private  int bsGetint()
           
private  int bsGetInt32()
           
private  int bsGetIntVS(int numBits)
           
private  char bsGetUChar()
           
private  int bsR(int n)
           
private  void bsSetStream(java.io.InputStream f)
           
private static void cadvise()
           
private  void complete()
           
private static void compressedStreamEOF()
           
private static void crcError()
           
private  void endBlock()
           
private  void getAndMoveToFrontDecode()
           
private  void hbCreateDecodeTables(int[] limit, int[] base, int[] perm, char[] length, int minLen, int maxLen, int alphaSize)
           
private  void initBlock()
           
private  void initialize()
           
private  void makeMaps()
           
 int read()
           
private  void recvDecodingTables()
           
private  void setDecompressStructureSizes(int newSize100k)
           
private  void setupBlock()
           
private  void setupNoRandPartA()
           
private  void setupNoRandPartB()
           
private  void setupNoRandPartC()
           
private  void setupRandPartA()
           
private  void setupRandPartB()
           
private  void setupRandPartC()
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

last

private int last

origPtr

private int origPtr

blockSize100k

private int blockSize100k

blockRandomised

private boolean blockRandomised

bsBuff

private int bsBuff

bsLive

private int bsLive

mCrc

private CRC mCrc

inUse

private boolean[] inUse

nInUse

private int nInUse

seqToUnseq

private char[] seqToUnseq

unseqToSeq

private char[] unseqToSeq

selector

private char[] selector

selectorMtf

private char[] selectorMtf

tt

private int[] tt

ll8

private char[] ll8

unzftab

private int[] unzftab

limit

private int[][] limit

base

private int[][] base

perm

private int[][] perm

minLens

private int[] minLens

bsStream

private java.io.InputStream bsStream

streamEnd

private boolean streamEnd

currentChar

private int currentChar

START_BLOCK_STATE

private static final int START_BLOCK_STATE
See Also:
Constant Field Values

RAND_PART_A_STATE

private static final int RAND_PART_A_STATE
See Also:
Constant Field Values

RAND_PART_B_STATE

private static final int RAND_PART_B_STATE
See Also:
Constant Field Values

RAND_PART_C_STATE

private static final int RAND_PART_C_STATE
See Also:
Constant Field Values

NO_RAND_PART_A_STATE

private static final int NO_RAND_PART_A_STATE
See Also:
Constant Field Values

NO_RAND_PART_B_STATE

private static final int NO_RAND_PART_B_STATE
See Also:
Constant Field Values

NO_RAND_PART_C_STATE

private static final int NO_RAND_PART_C_STATE
See Also:
Constant Field Values

currentState

private int currentState

storedBlockCRC

private int storedBlockCRC

computedCombinedCRC

private int computedCombinedCRC

i2

private int i2

count

private int count

chPrev

private int chPrev

ch2

private int ch2

i

private int i

tPos

private int tPos

rNToGo

private int rNToGo

rTPos

private int rTPos

j2

private int j2

z

private char z
Constructor Detail

CBZip2InputStream

public CBZip2InputStream(java.io.InputStream zStream)
Method Detail

cadvise

private static void cadvise()

compressedStreamEOF

private static void compressedStreamEOF()

makeMaps

private void makeMaps()

read

public int read()

initialize

private void initialize()

initBlock

private void initBlock()

endBlock

private void endBlock()

complete

private void complete()

blockOverrun

private static void blockOverrun()

badBlockHeader

private static void badBlockHeader()

crcError

private static void crcError()

bsFinishedWithStream

private void bsFinishedWithStream()

bsSetStream

private void bsSetStream(java.io.InputStream f)

bsR

private int bsR(int n)

bsGetUChar

private char bsGetUChar()

bsGetint

private int bsGetint()

bsGetIntVS

private int bsGetIntVS(int numBits)

bsGetInt32

private int bsGetInt32()

hbCreateDecodeTables

private void hbCreateDecodeTables(int[] limit,
                                  int[] base,
                                  int[] perm,
                                  char[] length,
                                  int minLen,
                                  int maxLen,
                                  int alphaSize)

recvDecodingTables

private void recvDecodingTables()

getAndMoveToFrontDecode

private void getAndMoveToFrontDecode()

setupBlock

private void setupBlock()

setupRandPartA

private void setupRandPartA()

setupNoRandPartA

private void setupNoRandPartA()

setupRandPartB

private void setupRandPartB()

setupRandPartC

private void setupRandPartC()

setupNoRandPartB

private void setupNoRandPartB()

setupNoRandPartC

private void setupNoRandPartC()

setDecompressStructureSizes

private void setDecompressStructureSizes(int newSize100k)