Package gov.nih.mipav.model.file
Class CBZip2OutputStream
java.lang.Object
java.io.OutputStream
gov.nih.mipav.model.file.CBZip2OutputStream
- All Implemented Interfaces:
BZip2Constants,Closeable,Flushable,AutoCloseable
An output stream that compresses into the BZip2 format (without the file
header chars) into another stream.
- Author:
- Keiron Liddle TODO: Update to BZip2 1.0.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate char[]private int(package private) boolean(package private) int(package private) int(package private) intprivate OutputStream(package private) intprotected static final int(package private) booleanprivate intprivate intprotected static final intprivate booleanprivate int[]protected static final intprivate int[]private boolean[](package private) intprotected static final int(package private) CRCprivate int[]private intprivate intprivate int(package private) intprotected static final intprivate int[]private intprivate char[]private char[]private char[]protected static final intprotected static final intprivate short[]private char[]private intprivate intprivate intprivate int[]Fields inherited from interface gov.nih.mipav.model.file.BZip2Constants
baseBlockSize, G_SIZE, MAX_ALPHA_SIZE, MAX_CODE_LEN, MAX_SELECTORS, N_GROUPS, N_ITERS, NUM_OVERSHOOT_BYTES, rNums, RUNA, RUNB -
Constructor Summary
ConstructorsConstructorDescriptionCBZip2OutputStream(OutputStream inStream) CBZip2OutputStream(OutputStream inStream, int inBlockSize) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprivate voidbsPutint(int u) private voidbsPutIntVS(int numBits, int c) private voidbsPutUChar(int c) private voidprivate voidbsW(int n, int v) voidclose()private voidprivate voidendBlock()private voidprotected voidfinalize()voidflush()private booleanfullGtU(int i1, int i2) private voidprivate voidhbAssignCodes(int[] code, char[] length, int minLen, int maxLen, int alphaSize) protected static voidhbMakeCodeLengths(char[] len, int[] freq, int alphaSize, int maxLen) private voidprivate voidprivate voidmainSort()private voidmakeMaps()private charmed3(char a, char b, char c) private voidprivate static voidpanic()private voidqSort3(int loSt, int hiSt, int dSt) private voidprivate voidprivate voidsimpleSort(int lo, int hi, int d) private voidvswap(int p1, int p2, int n) voidwrite(int bv) modified by Oliver Merkel, 010128private voidwriteRun()Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Field Details
-
SETMASK
protected static final int SETMASK- See Also:
-
CLEARMASK
protected static final int CLEARMASK- See Also:
-
GREATER_ICOST
protected static final int GREATER_ICOST- See Also:
-
LESSER_ICOST
protected static final int LESSER_ICOST- See Also:
-
SMALL_THRESH
protected static final int SMALL_THRESH- See Also:
-
DEPTH_THRESH
protected static final int DEPTH_THRESH- See Also:
-
QSORT_STACK_SIZE
protected static final int QSORT_STACK_SIZE- See Also:
-
last
int last -
origPtr
int origPtr -
blockSize100k
int blockSize100k -
blockRandomised
boolean blockRandomised -
bytesOut
int bytesOut -
bsBuff
int bsBuff -
bsLive
int bsLive -
mCrc
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 -
block
private char[] block -
quadrant
private int[] quadrant -
zptr
private int[] zptr -
szptr
private short[] szptr -
ftab
private int[] ftab -
nMTF
private int nMTF -
mtfFreq
private int[] mtfFreq -
workFactor
private int workFactor -
workDone
private int workDone -
workLimit
private int workLimit -
firstAttempt
private boolean firstAttempt -
nBlocksRandomised
private int nBlocksRandomised -
currentChar
private int currentChar -
runLength
private int runLength -
closed
boolean closed -
blockCRC
private int blockCRC -
combinedCRC
private int combinedCRC -
allowableBlockSize
private int allowableBlockSize -
bsStream
-
incs
private int[] incs
-
-
Constructor Details
-
CBZip2OutputStream
- Throws:
IOException
-
CBZip2OutputStream
- Throws:
IOException
-
-
Method Details
-
panic
private static void panic() -
makeMaps
private void makeMaps() -
hbMakeCodeLengths
protected static void hbMakeCodeLengths(char[] len, int[] freq, int alphaSize, int maxLen) -
write
modified by Oliver Merkel, 010128- Specified by:
writein classOutputStream- Throws:
IOException
-
writeRun
- Throws:
IOException
-
finalize
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
initialize
- Throws:
IOException
-
initBlock
private void initBlock() -
endBlock
- Throws:
IOException
-
endCompression
- Throws:
IOException
-
hbAssignCodes
private void hbAssignCodes(int[] code, char[] length, int minLen, int maxLen, int alphaSize) -
bsSetStream
-
bsFinishedWithStream
- Throws:
IOException
-
bsW
- Throws:
IOException
-
bsPutUChar
- Throws:
IOException
-
bsPutint
- Throws:
IOException
-
bsPutIntVS
- Throws:
IOException
-
sendMTFValues
- Throws:
IOException
-
moveToFrontCodeAndSend
- Throws:
IOException
-
simpleSort
private void simpleSort(int lo, int hi, int d) -
vswap
private void vswap(int p1, int p2, int n) -
med3
private char med3(char a, char b, char c) -
qSort3
private void qSort3(int loSt, int hiSt, int dSt) -
mainSort
private void mainSort() -
randomiseBlock
private void randomiseBlock() -
doReversibleTransformation
private void doReversibleTransformation() -
fullGtU
private boolean fullGtU(int i1, int i2) -
allocateCompressStructures
private void allocateCompressStructures() -
generateMTFValues
private void generateMTFValues()
-