Modified:
websites/production/commons/content/proper/commons-compress/jacoco/org.apache.commons.compress.compressors.bzip2/BZip2CompressorOutputStream.java.html
==============================================================================
---
websites/production/commons/content/proper/commons-compress/jacoco/org.apache.commons.compress.compressors.bzip2/BZip2CompressorOutputStream.java.html
(original)
+++
websites/production/commons/content/proper/commons-compress/jacoco/org.apache.commons.compress.compressors.bzip2/BZip2CompressorOutputStream.java.html
Tue Aug 20 11:56:50 2024
@@ -433,76 +433,80 @@ public class BZip2CompressorOutputStream
<span class="pc bpc" id="L433" title="1 of 2 branches missed."> if
(blockSize > 9) {</span>
<span class="nc" id="L434"> throw new
IllegalArgumentException("blockSize(" + blockSize + ") >
9");</span>
}
-
-<span class="fc" id="L437"> this.blockSize100k = blockSize;</span>
-
+<span class="fc" id="L436"> this.blockSize100k = blockSize;</span>
/* 20 is just a paranoia constant */
-<span class="fc" id="L440"> this.allowableBlockSize =
this.blockSize100k * BASEBLOCKSIZE - 20;</span>
-<span class="fc" id="L441"> init();</span>
-<span class="fc" id="L442"> }</span>
+<span class="fc" id="L438"> this.allowableBlockSize =
this.blockSize100k * BASEBLOCKSIZE - 20;</span>
+<span class="fc" id="L439"> init();</span>
+<span class="fc" id="L440"> }</span>
private void blockSort() {
-<span class="fc" id="L445"> blockSorter.blockSort(data, last);</span>
-<span class="fc" id="L446"> }</span>
+<span class="fc" id="L443"> blockSorter.blockSort(data, last);</span>
+<span class="fc" id="L444"> }</span>
private void bsFinishedWithStream() throws IOException {
-<span class="fc bfc" id="L449" title="All 2 branches covered."> while
(this.bsLive > 0) {</span>
-<span class="fc" id="L450"> final int ch = this.bsBuff >>
24;</span>
-<span class="fc" id="L451"> this.out.write(ch); // write
8-bit</span>
-<span class="fc" id="L452"> this.bsBuff <<= 8;</span>
-<span class="fc" id="L453"> this.bsLive -= 8;</span>
-<span class="fc" id="L454"> }</span>
-<span class="fc" id="L455"> }</span>
+<span class="fc bfc" id="L447" title="All 2 branches covered."> while
(this.bsLive > 0) {</span>
+<span class="fc" id="L448"> final int ch = this.bsBuff >>
24;</span>
+<span class="fc" id="L449"> this.out.write(ch); // write
8-bit</span>
+<span class="fc" id="L450"> this.bsBuff <<= 8;</span>
+<span class="fc" id="L451"> this.bsLive -= 8;</span>
+<span class="fc" id="L452"> }</span>
+<span class="fc" id="L453"> }</span>
private void bsPutInt(final int u) throws IOException {
-<span class="fc" id="L458"> bsW(8, u >> 24 & 0xff);</span>
-<span class="fc" id="L459"> bsW(8, u >> 16 & 0xff);</span>
-<span class="fc" id="L460"> bsW(8, u >> 8 & 0xff);</span>
-<span class="fc" id="L461"> bsW(8, u & 0xff);</span>
-<span class="fc" id="L462"> }</span>
+<span class="fc" id="L456"> bsW(8, u >> 24 & 0xff);</span>
+<span class="fc" id="L457"> bsW(8, u >> 16 & 0xff);</span>
+<span class="fc" id="L458"> bsW(8, u >> 8 & 0xff);</span>
+<span class="fc" id="L459"> bsW(8, u & 0xff);</span>
+<span class="fc" id="L460"> }</span>
private void bsPutUByte(final int c) throws IOException {
-<span class="fc" id="L465"> bsW(8, c);</span>
-<span class="fc" id="L466"> }</span>
+<span class="fc" id="L463"> bsW(8, c);</span>
+<span class="fc" id="L464"> }</span>
private void bsW(final int n, final int v) throws IOException {
-<span class="fc" id="L469"> final OutputStream outShadow =
this.out;</span>
-<span class="fc" id="L470"> int bsLiveShadow = this.bsLive;</span>
-<span class="fc" id="L471"> int bsBuffShadow = this.bsBuff;</span>
-
-<span class="fc bfc" id="L473" title="All 2 branches covered."> while
(bsLiveShadow >= 8) {</span>
-<span class="fc" id="L474"> outShadow.write(bsBuffShadow >>
24); // write 8-bit</span>
-<span class="fc" id="L475"> bsBuffShadow <<= 8;</span>
-<span class="fc" id="L476"> bsLiveShadow -= 8;</span>
+<span class="fc" id="L467"> final OutputStream outShadow =
this.out;</span>
+<span class="fc" id="L468"> int bsLiveShadow = this.bsLive;</span>
+<span class="fc" id="L469"> int bsBuffShadow = this.bsBuff;</span>
+
+<span class="fc bfc" id="L471" title="All 2 branches covered."> while
(bsLiveShadow >= 8) {</span>
+<span class="fc" id="L472"> outShadow.write(bsBuffShadow >>
24); // write 8-bit</span>
+<span class="fc" id="L473"> bsBuffShadow <<= 8;</span>
+<span class="fc" id="L474"> bsLiveShadow -= 8;</span>
}
-<span class="fc" id="L479"> this.bsBuff = bsBuffShadow | v << 32
- bsLiveShadow - n;</span>
-<span class="fc" id="L480"> this.bsLive = bsLiveShadow + n;</span>
-<span class="fc" id="L481"> }</span>
+<span class="fc" id="L477"> this.bsBuff = bsBuffShadow | v << 32
- bsLiveShadow - n;</span>
+<span class="fc" id="L478"> this.bsLive = bsLiveShadow + n;</span>
+<span class="fc" id="L479"> }</span>
+
+ private void checkClosed() throws IOException {
+<span class="pc bpc" id="L482" title="1 of 2 branches missed."> if
(closed) {</span>
+<span class="nc" id="L483"> throw new IOException("Stream
closed");</span>
+ }
+<span class="fc" id="L485"> }</span>
@Override
public void close() throws IOException {
-<span class="fc bfc" id="L485" title="All 2 branches covered."> if
(!closed) {</span>
+<span class="fc bfc" id="L489" title="All 2 branches covered."> if
(!closed) {</span>
try {
-<span class="fc" id="L487"> finish();</span>
+<span class="fc" id="L491"> finish();</span>
} finally {
-<span class="fc" id="L489"> IOUtils.close(out);</span>
+<span class="fc" id="L493"> IOUtils.close(out);</span>
}
}
-<span class="fc" id="L492"> }</span>
+<span class="fc" id="L496"> }</span>
private void endBlock() throws IOException {
-<span class="fc" id="L495"> final int blockCRC =
this.crc.getValue();</span>
-<span class="fc" id="L496"> this.combinedCRC = this.combinedCRC
<< 1 | this.combinedCRC >>> 31;</span>
-<span class="fc" id="L497"> this.combinedCRC ^= blockCRC;</span>
+<span class="fc" id="L499"> final int blockCRC =
this.crc.getValue();</span>
+<span class="fc" id="L500"> this.combinedCRC = this.combinedCRC
<< 1 | this.combinedCRC >>> 31;</span>
+<span class="fc" id="L501"> this.combinedCRC ^= blockCRC;</span>
// empty block at end of file
-<span class="pc bpc" id="L500" title="1 of 2 branches missed."> if
(this.last == -1) {</span>
-<span class="nc" id="L501"> return;</span>
+<span class="pc bpc" id="L504" title="1 of 2 branches missed."> if
(this.last == -1) {</span>
+<span class="nc" id="L505"> return;</span>
}
/* sort the block and establish posn of original string */
-<span class="fc" id="L505"> blockSort();</span>
+<span class="fc" id="L509"> blockSort();</span>
/*
* A 6-byte block header, the value chosen arbitrarily as
0x314159265359 :-). A 32 bit value does not really give a strong enough
guarantee that the
@@ -510,64 +514,62 @@ public class BZip2CompressorOutputStream
* 1.0e-5 for 40 bits and 4.0e-8 for 48 bits. For a compressed file of
size 100Gb -- about 100000 blocks -- only a 48-bit marker will do. NB: normal
* compression/ decompression doesn't rely on these statistical
properties. They are only important when trying to recover blocks from damaged
files.
*/
-<span class="fc" id="L513"> bsPutUByte(0x31);</span>
-<span class="fc" id="L514"> bsPutUByte(0x41);</span>
-<span class="fc" id="L515"> bsPutUByte(0x59);</span>
-<span class="fc" id="L516"> bsPutUByte(0x26);</span>
-<span class="fc" id="L517"> bsPutUByte(0x53);</span>
-<span class="fc" id="L518"> bsPutUByte(0x59);</span>
+<span class="fc" id="L517"> bsPutUByte(0x31);</span>
+<span class="fc" id="L518"> bsPutUByte(0x41);</span>
+<span class="fc" id="L519"> bsPutUByte(0x59);</span>
+<span class="fc" id="L520"> bsPutUByte(0x26);</span>
+<span class="fc" id="L521"> bsPutUByte(0x53);</span>
+<span class="fc" id="L522"> bsPutUByte(0x59);</span>
/* Now the block's CRC, so it is in a known place. */
-<span class="fc" id="L521"> bsPutInt(blockCRC);</span>
+<span class="fc" id="L525"> bsPutInt(blockCRC);</span>
/* Now a single bit indicating no randomization. */
-<span class="fc" id="L524"> bsW(1, 0);</span>
+<span class="fc" id="L528"> bsW(1, 0);</span>
/* Finally, block's contents proper. */
-<span class="fc" id="L527"> moveToFrontCodeAndSend();</span>
-<span class="fc" id="L528"> }</span>
+<span class="fc" id="L531"> moveToFrontCodeAndSend();</span>
+<span class="fc" id="L532"> }</span>
private void endCompression() throws IOException {
/*
* Now another magic 48-bit number, 0x177245385090, to indicate the
end of the last block. (sqrt(pi), if you want to know. I did want to use e, but
it
* contains too much repetition -- 27 18 28 18 28 46 -- for me to feel
statistically comfortable. Call me paranoid.)
*/
-<span class="fc" id="L535"> bsPutUByte(0x17);</span>
-<span class="fc" id="L536"> bsPutUByte(0x72);</span>
-<span class="fc" id="L537"> bsPutUByte(0x45);</span>
-<span class="fc" id="L538"> bsPutUByte(0x38);</span>
-<span class="fc" id="L539"> bsPutUByte(0x50);</span>
-<span class="fc" id="L540"> bsPutUByte(0x90);</span>
-
-<span class="fc" id="L542"> bsPutInt(this.combinedCRC);</span>
-<span class="fc" id="L543"> bsFinishedWithStream();</span>
-<span class="fc" id="L544"> }</span>
+<span class="fc" id="L539"> bsPutUByte(0x17);</span>
+<span class="fc" id="L540"> bsPutUByte(0x72);</span>
+<span class="fc" id="L541"> bsPutUByte(0x45);</span>
+<span class="fc" id="L542"> bsPutUByte(0x38);</span>
+<span class="fc" id="L543"> bsPutUByte(0x50);</span>
+<span class="fc" id="L544"> bsPutUByte(0x90);</span>
+
+<span class="fc" id="L546"> bsPutInt(this.combinedCRC);</span>
+<span class="fc" id="L547"> bsFinishedWithStream();</span>
+<span class="fc" id="L548"> }</span>
public void finish() throws IOException {
-<span class="pc bpc" id="L547" title="1 of 2 branches missed."> if
(!closed) {</span>
-<span class="fc" id="L548"> closed = true;</span>
+<span class="pc bpc" id="L551" title="1 of 2 branches missed."> if
(!closed) {</span>
+<span class="fc" id="L552"> closed = true;</span>
try {
-<span class="pc bpc" id="L550" title="1 of 2 branches missed.">
if (this.runLength > 0) {</span>
-<span class="fc" id="L551"> writeRun();</span>
+<span class="pc bpc" id="L554" title="1 of 2 branches missed.">
if (this.runLength > 0) {</span>
+<span class="fc" id="L555"> writeRun();</span>
}
-<span class="fc" id="L553"> this.currentChar = -1;</span>
-<span class="fc" id="L554"> endBlock();</span>
-<span class="fc" id="L555"> endCompression();</span>
+<span class="fc" id="L557"> this.currentChar = -1;</span>
+<span class="fc" id="L558"> endBlock();</span>
+<span class="fc" id="L559"> endCompression();</span>
} finally {
-<span class="fc" id="L557"> this.out = null;</span>
-<span class="fc" id="L558"> this.blockSorter = null;</span>
-<span class="fc" id="L559"> this.data = null;</span>
+<span class="fc" id="L561"> this.blockSorter = null;</span>
+<span class="fc" id="L562"> this.data = null;</span>
}
}
-<span class="fc" id="L562"> }</span>
+<span class="fc" id="L565"> }</span>
@Override
public void flush() throws IOException {
-<span class="fc" id="L566"> final OutputStream outShadow =
this.out;</span>
-<span class="pc bpc" id="L567" title="1 of 2 branches missed."> if
(outShadow != null) {</span>
-<span class="fc" id="L568"> outShadow.flush();</span>
+<span class="pc bpc" id="L569" title="1 of 2 branches missed."> if (out
!= null) {</span>
+<span class="fc" id="L570"> super.flush();</span>
}
-<span class="fc" id="L570"> }</span>
+<span class="fc" id="L572"> }</span>
/*
* Performs Move-To-Front on the Burrows-Wheeler transformed buffer,
storing the MTFed data in data.sfmap in RUNA/RUNB run-length-encoded form.
@@ -575,103 +577,103 @@ public class BZip2CompressorOutputStream
* <p>Keeps track of byte frequencies in data.mtfFreq at the same
time.</p>
*/
private void generateMTFValues() {
-<span class="fc" id="L578"> final int lastShadow = this.last;</span>
-<span class="fc" id="L579"> final Data dataShadow = this.data;</span>
-<span class="fc" id="L580"> final boolean[] inUse =
dataShadow.inUse;</span>
-<span class="fc" id="L581"> final byte[] block =
dataShadow.block;</span>
-<span class="fc" id="L582"> final int[] fmap = dataShadow.fmap;</span>
-<span class="fc" id="L583"> final char[] sfmap =
dataShadow.sfmap;</span>
-<span class="fc" id="L584"> final int[] mtfFreq =
dataShadow.mtfFreq;</span>
-<span class="fc" id="L585"> final byte[] unseqToSeq =
dataShadow.unseqToSeq;</span>
-<span class="fc" id="L586"> final byte[] yy =
dataShadow.generateMTFValues_yy;</span>
+<span class="fc" id="L580"> final int lastShadow = this.last;</span>
+<span class="fc" id="L581"> final Data dataShadow = this.data;</span>
+<span class="fc" id="L582"> final boolean[] inUse =
dataShadow.inUse;</span>
+<span class="fc" id="L583"> final byte[] block =
dataShadow.block;</span>
+<span class="fc" id="L584"> final int[] fmap = dataShadow.fmap;</span>
+<span class="fc" id="L585"> final char[] sfmap =
dataShadow.sfmap;</span>
+<span class="fc" id="L586"> final int[] mtfFreq =
dataShadow.mtfFreq;</span>
+<span class="fc" id="L587"> final byte[] unseqToSeq =
dataShadow.unseqToSeq;</span>
+<span class="fc" id="L588"> final byte[] yy =
dataShadow.generateMTFValues_yy;</span>
// make maps
-<span class="fc" id="L589"> int nInUseShadow = 0;</span>
-<span class="fc bfc" id="L590" title="All 2 branches covered."> for
(int i = 0; i < 256; i++) {</span>
-<span class="fc bfc" id="L591" title="All 2 branches covered."> if
(inUse[i]) {</span>
-<span class="fc" id="L592"> unseqToSeq[i] = (byte)
nInUseShadow;</span>
-<span class="fc" id="L593"> nInUseShadow++;</span>
+<span class="fc" id="L591"> int nInUseShadow = 0;</span>
+<span class="fc bfc" id="L592" title="All 2 branches covered."> for
(int i = 0; i < 256; i++) {</span>
+<span class="fc bfc" id="L593" title="All 2 branches covered."> if
(inUse[i]) {</span>
+<span class="fc" id="L594"> unseqToSeq[i] = (byte)
nInUseShadow;</span>
+<span class="fc" id="L595"> nInUseShadow++;</span>
}
}
-<span class="fc" id="L596"> this.nInUse = nInUseShadow;</span>
+<span class="fc" id="L598"> this.nInUse = nInUseShadow;</span>
-<span class="fc" id="L598"> final int eob = nInUseShadow + 1;</span>
+<span class="fc" id="L600"> final int eob = nInUseShadow + 1;</span>
-<span class="fc" id="L600"> Arrays.fill(mtfFreq, 0, eob + 1, 0);</span>
+<span class="fc" id="L602"> Arrays.fill(mtfFreq, 0, eob + 1, 0);</span>
-<span class="fc bfc" id="L602" title="All 2 branches covered."> for
(int i = nInUseShadow; --i >= 0;) {</span>
-<span class="fc" id="L603"> yy[i] = (byte) i;</span>
+<span class="fc bfc" id="L604" title="All 2 branches covered."> for
(int i = nInUseShadow; --i >= 0;) {</span>
+<span class="fc" id="L605"> yy[i] = (byte) i;</span>
}
-<span class="fc" id="L606"> int wr = 0;</span>
-<span class="fc" id="L607"> int zPend = 0;</span>
+<span class="fc" id="L608"> int wr = 0;</span>
+<span class="fc" id="L609"> int zPend = 0;</span>
-<span class="fc bfc" id="L609" title="All 2 branches covered."> for
(int i = 0; i <= lastShadow; i++) {</span>
-<span class="fc" id="L610"> final byte ll_i =
unseqToSeq[block[fmap[i]] & 0xff];</span>
-<span class="fc" id="L611"> byte tmp = yy[0];</span>
-<span class="fc" id="L612"> int j = 0;</span>
+<span class="fc bfc" id="L611" title="All 2 branches covered."> for
(int i = 0; i <= lastShadow; i++) {</span>
+<span class="fc" id="L612"> final byte ll_i =
unseqToSeq[block[fmap[i]] & 0xff];</span>
+<span class="fc" id="L613"> byte tmp = yy[0];</span>
+<span class="fc" id="L614"> int j = 0;</span>
-<span class="fc bfc" id="L614" title="All 2 branches covered.">
while (ll_i != tmp) {</span>
-<span class="fc" id="L615"> j++;</span>
-<span class="fc" id="L616"> final byte tmp2 = tmp;</span>
-<span class="fc" id="L617"> tmp = yy[j];</span>
-<span class="fc" id="L618"> yy[j] = tmp2;</span>
-<span class="fc" id="L619"> }</span>
-<span class="fc" id="L620"> yy[0] = tmp;</span>
+<span class="fc bfc" id="L616" title="All 2 branches covered.">
while (ll_i != tmp) {</span>
+<span class="fc" id="L617"> j++;</span>
+<span class="fc" id="L618"> final byte tmp2 = tmp;</span>
+<span class="fc" id="L619"> tmp = yy[j];</span>
+<span class="fc" id="L620"> yy[j] = tmp2;</span>
+<span class="fc" id="L621"> }</span>
+<span class="fc" id="L622"> yy[0] = tmp;</span>
-<span class="fc bfc" id="L622" title="All 2 branches covered."> if
(j == 0) {</span>
-<span class="fc" id="L623"> zPend++;</span>
+<span class="fc bfc" id="L624" title="All 2 branches covered."> if
(j == 0) {</span>
+<span class="fc" id="L625"> zPend++;</span>
} else {
-<span class="fc bfc" id="L625" title="All 2 branches covered.">
if (zPend > 0) {</span>
-<span class="fc" id="L626"> zPend--;</span>
+<span class="fc bfc" id="L627" title="All 2 branches covered.">
if (zPend > 0) {</span>
+<span class="fc" id="L628"> zPend--;</span>
while (true) {
-<span class="fc bfc" id="L628" title="All 2 branches covered.">
if ((zPend & 1) == 0) {</span>
-<span class="fc" id="L629"> sfmap[wr] = RUNA;</span>
-<span class="fc" id="L630"> wr++;</span>
-<span class="fc" id="L631"> mtfFreq[RUNA]++;</span>
+<span class="fc bfc" id="L630" title="All 2 branches covered.">
if ((zPend & 1) == 0) {</span>
+<span class="fc" id="L631"> sfmap[wr] = RUNA;</span>
+<span class="fc" id="L632"> wr++;</span>
+<span class="fc" id="L633"> mtfFreq[RUNA]++;</span>
} else {
-<span class="fc" id="L633"> sfmap[wr] = RUNB;</span>
-<span class="fc" id="L634"> wr++;</span>
-<span class="fc" id="L635"> mtfFreq[RUNB]++;</span>
+<span class="fc" id="L635"> sfmap[wr] = RUNB;</span>
+<span class="fc" id="L636"> wr++;</span>
+<span class="fc" id="L637"> mtfFreq[RUNB]++;</span>
}
-<span class="fc bfc" id="L638" title="All 2 branches covered.">
if (zPend < 2) {</span>
-<span class="fc" id="L639"> break;</span>
+<span class="fc bfc" id="L640" title="All 2 branches covered.">
if (zPend < 2) {</span>
+<span class="fc" id="L641"> break;</span>
}
-<span class="fc" id="L641"> zPend = zPend - 2 >>
1;</span>
+<span class="fc" id="L643"> zPend = zPend - 2 >>
1;</span>
}
-<span class="fc" id="L643"> zPend = 0;</span>
+<span class="fc" id="L645"> zPend = 0;</span>
}
-<span class="fc" id="L645"> sfmap[wr] = (char) (j + 1);</span>
-<span class="fc" id="L646"> wr++;</span>
-<span class="fc" id="L647"> mtfFreq[j + 1]++;</span>
+<span class="fc" id="L647"> sfmap[wr] = (char) (j + 1);</span>
+<span class="fc" id="L648"> wr++;</span>
+<span class="fc" id="L649"> mtfFreq[j + 1]++;</span>
}
}
-<span class="fc bfc" id="L651" title="All 2 branches covered."> if
(zPend > 0) {</span>
-<span class="fc" id="L652"> zPend--;</span>
+<span class="fc bfc" id="L653" title="All 2 branches covered."> if
(zPend > 0) {</span>
+<span class="fc" id="L654"> zPend--;</span>
while (true) {
-<span class="pc bpc" id="L654" title="1 of 2 branches missed.">
if ((zPend & 1) == 0) {</span>
-<span class="fc" id="L655"> sfmap[wr] = RUNA;</span>
-<span class="fc" id="L656"> wr++;</span>
-<span class="fc" id="L657"> mtfFreq[RUNA]++;</span>
+<span class="pc bpc" id="L656" title="1 of 2 branches missed.">
if ((zPend & 1) == 0) {</span>
+<span class="fc" id="L657"> sfmap[wr] = RUNA;</span>
+<span class="fc" id="L658"> wr++;</span>
+<span class="fc" id="L659"> mtfFreq[RUNA]++;</span>
} else {
-<span class="nc" id="L659"> sfmap[wr] = RUNB;</span>
-<span class="nc" id="L660"> wr++;</span>
-<span class="nc" id="L661"> mtfFreq[RUNB]++;</span>
+<span class="nc" id="L661"> sfmap[wr] = RUNB;</span>
+<span class="nc" id="L662"> wr++;</span>
+<span class="nc" id="L663"> mtfFreq[RUNB]++;</span>
}
-<span class="pc bpc" id="L664" title="1 of 2 branches missed.">
if (zPend < 2) {</span>
-<span class="fc" id="L665"> break;</span>
+<span class="pc bpc" id="L666" title="1 of 2 branches missed.">
if (zPend < 2) {</span>
+<span class="fc" id="L667"> break;</span>
}
-<span class="nc" id="L667"> zPend = zPend - 2 >> 1;</span>
+<span class="nc" id="L669"> zPend = zPend - 2 >> 1;</span>
}
}
-<span class="fc" id="L671"> sfmap[wr] = (char) eob;</span>
-<span class="fc" id="L672"> mtfFreq[eob]++;</span>
-<span class="fc" id="L673"> this.nMTF = wr + 1;</span>
-<span class="fc" id="L674"> }</span>
+<span class="fc" id="L673"> sfmap[wr] = (char) eob;</span>
+<span class="fc" id="L674"> mtfFreq[eob]++;</span>
+<span class="fc" id="L675"> this.nMTF = wr + 1;</span>
+<span class="fc" id="L676"> }</span>
/**
* Returns the blocksize parameter specified at construction time.
@@ -679,7 +681,7 @@ public class BZip2CompressorOutputStream
* @return the blocksize parameter specified at construction time
*/
public final int getBlockSize() {
-<span class="nc" id="L682"> return this.blockSize100k;</span>
+<span class="nc" id="L684"> return this.blockSize100k;</span>
}
/**
@@ -689,189 +691,189 @@ public class BZip2CompressorOutputStream
* @throws IOException if the magic bytes could not been written
*/
private void init() throws IOException {
-<span class="fc" id="L692"> bsPutUByte('B');</span>
-<span class="fc" id="L693"> bsPutUByte('Z');</span>
+<span class="fc" id="L694"> bsPutUByte('B');</span>
+<span class="fc" id="L695"> bsPutUByte('Z');</span>
-<span class="fc" id="L695"> this.data = new
Data(this.blockSize100k);</span>
-<span class="fc" id="L696"> this.blockSorter = new
BlockSort(this.data);</span>
+<span class="fc" id="L697"> this.data = new
Data(this.blockSize100k);</span>
+<span class="fc" id="L698"> this.blockSorter = new
BlockSort(this.data);</span>
// huffmanized magic bytes
-<span class="fc" id="L699"> bsPutUByte('h');</span>
-<span class="fc" id="L700"> bsPutUByte('0' + this.blockSize100k);</span>
+<span class="fc" id="L701"> bsPutUByte('h');</span>
+<span class="fc" id="L702"> bsPutUByte('0' + this.blockSize100k);</span>
-<span class="fc" id="L702"> this.combinedCRC = 0;</span>
-<span class="fc" id="L703"> initBlock();</span>
-<span class="fc" id="L704"> }</span>
+<span class="fc" id="L704"> this.combinedCRC = 0;</span>
+<span class="fc" id="L705"> initBlock();</span>
+<span class="fc" id="L706"> }</span>
private void initBlock() {
// blockNo++;
-<span class="fc" id="L708"> this.crc.reset();</span>
-<span class="fc" id="L709"> this.last = -1;</span>
+<span class="fc" id="L710"> this.crc.reset();</span>
+<span class="fc" id="L711"> this.last = -1;</span>
// ch = 0;
-<span class="fc" id="L712"> final boolean[] inUse =
this.data.inUse;</span>
-<span class="fc bfc" id="L713" title="All 2 branches covered."> for
(int i = 256; --i >= 0;) {</span>
-<span class="fc" id="L714"> inUse[i] = false;</span>
+<span class="fc" id="L714"> final boolean[] inUse =
this.data.inUse;</span>
+<span class="fc bfc" id="L715" title="All 2 branches covered."> for
(int i = 256; --i >= 0;) {</span>
+<span class="fc" id="L716"> inUse[i] = false;</span>
}
-<span class="fc" id="L717"> }</span>
+<span class="fc" id="L719"> }</span>
private void moveToFrontCodeAndSend() throws IOException {
-<span class="fc" id="L720"> bsW(24, this.data.origPtr);</span>
-<span class="fc" id="L721"> generateMTFValues();</span>
-<span class="fc" id="L722"> sendMTFValues();</span>
-<span class="fc" id="L723"> }</span>
+<span class="fc" id="L722"> bsW(24, this.data.origPtr);</span>
+<span class="fc" id="L723"> generateMTFValues();</span>
+<span class="fc" id="L724"> sendMTFValues();</span>
+<span class="fc" id="L725"> }</span>
private void sendMTFValues() throws IOException {
-<span class="fc" id="L726"> final byte[][] len =
this.data.sendMTFValues_len;</span>
-<span class="fc" id="L727"> final int alphaSize = this.nInUse +
2;</span>
+<span class="fc" id="L728"> final byte[][] len =
this.data.sendMTFValues_len;</span>
+<span class="fc" id="L729"> final int alphaSize = this.nInUse +
2;</span>
-<span class="fc bfc" id="L729" title="All 2 branches covered."> for
(int t = N_GROUPS; --t >= 0;) {</span>
-<span class="fc" id="L730"> final byte[] len_t = len[t];</span>
-<span class="fc bfc" id="L731" title="All 2 branches covered."> for
(int v = alphaSize; --v >= 0;) {</span>
-<span class="fc" id="L732"> len_t[v] = GREATER_ICOST;</span>
+<span class="fc bfc" id="L731" title="All 2 branches covered."> for
(int t = N_GROUPS; --t >= 0;) {</span>
+<span class="fc" id="L732"> final byte[] len_t = len[t];</span>
+<span class="fc bfc" id="L733" title="All 2 branches covered."> for
(int v = alphaSize; --v >= 0;) {</span>
+<span class="fc" id="L734"> len_t[v] = GREATER_ICOST;</span>
}
-<span class="fc" id="L734"> }</span>
+<span class="fc" id="L736"> }</span>
/* Decide how many coding tables to use */
// assert (this.nMTF > 0) : this.nMTF;
-<span class="pc bpc" id="L738" title="2 of 8 branches missed."> final
int nGroups = this.nMTF < 200 ? 2 : this.nMTF < 600 ? 3 : this.nMTF <
1200 ? 4 : this.nMTF < 2400 ? 5 : 6;</span>
+<span class="pc bpc" id="L740" title="2 of 8 branches missed."> final
int nGroups = this.nMTF < 200 ? 2 : this.nMTF < 600 ? 3 : this.nMTF <
1200 ? 4 : this.nMTF < 2400 ? 5 : 6;</span>
/* Generate an initial set of coding tables */
-<span class="fc" id="L741"> sendMTFValues0(nGroups, alphaSize);</span>
+<span class="fc" id="L743"> sendMTFValues0(nGroups, alphaSize);</span>
/*
* Iterate up to N_ITERS times to improve the tables.
*/
-<span class="fc" id="L746"> final int nSelectors =
sendMTFValues1(nGroups, alphaSize);</span>
+<span class="fc" id="L748"> final int nSelectors =
sendMTFValues1(nGroups, alphaSize);</span>
/* Compute MTF values for the selectors. */
-<span class="fc" id="L749"> sendMTFValues2(nGroups, nSelectors);</span>
+<span class="fc" id="L751"> sendMTFValues2(nGroups, nSelectors);</span>
/* Assign actual codes for the tables. */
-<span class="fc" id="L752"> sendMTFValues3(nGroups, alphaSize);</span>
+<span class="fc" id="L754"> sendMTFValues3(nGroups, alphaSize);</span>
/* Transmit the mapping table. */
-<span class="fc" id="L755"> sendMTFValues4();</span>
+<span class="fc" id="L757"> sendMTFValues4();</span>
/* Now the selectors. */
-<span class="fc" id="L758"> sendMTFValues5(nGroups, nSelectors);</span>
+<span class="fc" id="L760"> sendMTFValues5(nGroups, nSelectors);</span>
/* Now the coding tables. */
-<span class="fc" id="L761"> sendMTFValues6(nGroups, alphaSize);</span>
+<span class="fc" id="L763"> sendMTFValues6(nGroups, alphaSize);</span>
/* And finally, the block data proper */
-<span class="fc" id="L764"> sendMTFValues7();</span>
-<span class="fc" id="L765"> }</span>
+<span class="fc" id="L766"> sendMTFValues7();</span>
+<span class="fc" id="L767"> }</span>
private void sendMTFValues0(final int nGroups, final int alphaSize) {
-<span class="fc" id="L768"> final byte[][] len =
this.data.sendMTFValues_len;</span>
-<span class="fc" id="L769"> final int[] mtfFreq =
this.data.mtfFreq;</span>
+<span class="fc" id="L770"> final byte[][] len =
this.data.sendMTFValues_len;</span>
+<span class="fc" id="L771"> final int[] mtfFreq =
this.data.mtfFreq;</span>
-<span class="fc" id="L771"> int remF = this.nMTF;</span>
-<span class="fc" id="L772"> int gs = 0;</span>
+<span class="fc" id="L773"> int remF = this.nMTF;</span>
+<span class="fc" id="L774"> int gs = 0;</span>
-<span class="fc bfc" id="L774" title="All 2 branches covered."> for
(int nPart = nGroups; nPart > 0; nPart--) {</span>
-<span class="fc" id="L775"> final int tFreq = remF / nPart;</span>
-<span class="fc" id="L776"> int ge = gs - 1;</span>
-<span class="fc" id="L777"> int aFreq = 0;</span>
+<span class="fc bfc" id="L776" title="All 2 branches covered."> for
(int nPart = nGroups; nPart > 0; nPart--) {</span>
+<span class="fc" id="L777"> final int tFreq = remF / nPart;</span>
+<span class="fc" id="L778"> int ge = gs - 1;</span>
+<span class="fc" id="L779"> int aFreq = 0;</span>
-<span class="pc bpc" id="L779" title="1 of 4 branches missed."> for
(final int a = alphaSize - 1; aFreq < tFreq && ge < a;) {</span>
-<span class="fc" id="L780"> aFreq += mtfFreq[++ge];</span>
+<span class="pc bpc" id="L781" title="1 of 4 branches missed."> for
(final int a = alphaSize - 1; aFreq < tFreq && ge < a;) {</span>
+<span class="fc" id="L782"> aFreq += mtfFreq[++ge];</span>
}
-<span class="fc bfc" id="L783" title="All 8 branches covered."> if
(ge > gs && nPart != nGroups && nPart != 1 &&
(nGroups - nPart & 1) != 0) {</span>
-<span class="fc" id="L784"> aFreq -= mtfFreq[ge--];</span>
+<span class="fc bfc" id="L785" title="All 8 branches covered."> if
(ge > gs && nPart != nGroups && nPart != 1 &&
(nGroups - nPart & 1) != 0) {</span>
+<span class="fc" id="L786"> aFreq -= mtfFreq[ge--];</span>
}
-<span class="fc" id="L787"> final byte[] len_np = len[nPart -
1];</span>
-<span class="fc bfc" id="L788" title="All 2 branches covered."> for
(int v = alphaSize; --v >= 0;) {</span>
-<span class="fc bfc" id="L789" title="All 4 branches covered.">
if (v >= gs && v <= ge) {</span>
-<span class="fc" id="L790"> len_np[v] = LESSER_ICOST;</span>
+<span class="fc" id="L789"> final byte[] len_np = len[nPart -
1];</span>
+<span class="fc bfc" id="L790" title="All 2 branches covered."> for
(int v = alphaSize; --v >= 0;) {</span>
+<span class="fc bfc" id="L791" title="All 4 branches covered.">
if (v >= gs && v <= ge) {</span>
+<span class="fc" id="L792"> len_np[v] = LESSER_ICOST;</span>
} else {
-<span class="fc" id="L792"> len_np[v] =
GREATER_ICOST;</span>
+<span class="fc" id="L794"> len_np[v] =
GREATER_ICOST;</span>
}
}
-<span class="fc" id="L796"> gs = ge + 1;</span>
-<span class="fc" id="L797"> remF -= aFreq;</span>
+<span class="fc" id="L798"> gs = ge + 1;</span>
+<span class="fc" id="L799"> remF -= aFreq;</span>
}
-<span class="fc" id="L799"> }</span>
+<span class="fc" id="L801"> }</span>
private int sendMTFValues1(final int nGroups, final int alphaSize) {
-<span class="fc" id="L802"> final Data dataShadow = this.data;</span>
-<span class="fc" id="L803"> final int[][] rfreq =
dataShadow.sendMTFValues_rfreq;</span>
-<span class="fc" id="L804"> final int[] fave =
dataShadow.sendMTFValues_fave;</span>
-<span class="fc" id="L805"> final short[] cost =
dataShadow.sendMTFValues_cost;</span>
-<span class="fc" id="L806"> final char[] sfmap =
dataShadow.sfmap;</span>
-<span class="fc" id="L807"> final byte[] selector =
dataShadow.selector;</span>
-<span class="fc" id="L808"> final byte[][] len =
dataShadow.sendMTFValues_len;</span>
-<span class="fc" id="L809"> final byte[] len_0 = len[0];</span>
-<span class="fc" id="L810"> final byte[] len_1 = len[1];</span>
-<span class="fc" id="L811"> final byte[] len_2 = len[2];</span>
-<span class="fc" id="L812"> final byte[] len_3 = len[3];</span>
-<span class="fc" id="L813"> final byte[] len_4 = len[4];</span>
-<span class="fc" id="L814"> final byte[] len_5 = len[5];</span>
-<span class="fc" id="L815"> final int nMTFShadow = this.nMTF;</span>
-
-<span class="fc" id="L817"> int nSelectors = 0;</span>
-
-<span class="fc bfc" id="L819" title="All 2 branches covered."> for
(int iter = 0; iter < N_ITERS; iter++) {</span>
-<span class="fc bfc" id="L820" title="All 2 branches covered."> for
(int t = nGroups; --t >= 0;) {</span>
-<span class="fc" id="L821"> fave[t] = 0;</span>
-<span class="fc" id="L822"> final int[] rfreqt =
rfreq[t];</span>
-<span class="fc bfc" id="L823" title="All 2 branches covered.">
for (int i = alphaSize; --i >= 0;) {</span>
-<span class="fc" id="L824"> rfreqt[i] = 0;</span>
+<span class="fc" id="L804"> final Data dataShadow = this.data;</span>
+<span class="fc" id="L805"> final int[][] rfreq =
dataShadow.sendMTFValues_rfreq;</span>
+<span class="fc" id="L806"> final int[] fave =
dataShadow.sendMTFValues_fave;</span>
+<span class="fc" id="L807"> final short[] cost =
dataShadow.sendMTFValues_cost;</span>
+<span class="fc" id="L808"> final char[] sfmap =
dataShadow.sfmap;</span>
+<span class="fc" id="L809"> final byte[] selector =
dataShadow.selector;</span>
+<span class="fc" id="L810"> final byte[][] len =
dataShadow.sendMTFValues_len;</span>
+<span class="fc" id="L811"> final byte[] len_0 = len[0];</span>
+<span class="fc" id="L812"> final byte[] len_1 = len[1];</span>
+<span class="fc" id="L813"> final byte[] len_2 = len[2];</span>
+<span class="fc" id="L814"> final byte[] len_3 = len[3];</span>
+<span class="fc" id="L815"> final byte[] len_4 = len[4];</span>
+<span class="fc" id="L816"> final byte[] len_5 = len[5];</span>
+<span class="fc" id="L817"> final int nMTFShadow = this.nMTF;</span>
+
+<span class="fc" id="L819"> int nSelectors = 0;</span>
+
+<span class="fc bfc" id="L821" title="All 2 branches covered."> for
(int iter = 0; iter < N_ITERS; iter++) {</span>
+<span class="fc bfc" id="L822" title="All 2 branches covered."> for
(int t = nGroups; --t >= 0;) {</span>
+<span class="fc" id="L823"> fave[t] = 0;</span>
+<span class="fc" id="L824"> final int[] rfreqt =
rfreq[t];</span>
+<span class="fc bfc" id="L825" title="All 2 branches covered.">
for (int i = alphaSize; --i >= 0;) {</span>
+<span class="fc" id="L826"> rfreqt[i] = 0;</span>
}
-<span class="fc" id="L826"> }</span>
+<span class="fc" id="L828"> }</span>
-<span class="fc" id="L828"> nSelectors = 0;</span>
+<span class="fc" id="L830"> nSelectors = 0;</span>
-<span class="fc bfc" id="L830" title="All 2 branches covered."> for
(int gs = 0; gs < this.nMTF;) {</span>
+<span class="fc bfc" id="L832" title="All 2 branches covered."> for
(int gs = 0; gs < this.nMTF;) {</span>
// Set group start & end marks.
// Calculate the cost of this group as coded by each of the
// coding tables.
-<span class="fc" id="L836"> final int ge = Math.min(gs + G_SIZE
- 1, nMTFShadow - 1);</span>
+<span class="fc" id="L838"> final int ge = Math.min(gs + G_SIZE
- 1, nMTFShadow - 1);</span>
-<span class="fc" id="L838"> final byte mask = (byte)
0xff;</span>
-<span class="fc bfc" id="L839" title="All 2 branches covered.">
if (nGroups == N_GROUPS) {</span>
+<span class="fc" id="L840"> final byte mask = (byte)
0xff;</span>
+<span class="fc bfc" id="L841" title="All 2 branches covered.">
if (nGroups == N_GROUPS) {</span>
// unrolled version of the else-block
-<span class="fc" id="L842"> short cost0 = 0;</span>
-<span class="fc" id="L843"> short cost1 = 0;</span>
-<span class="fc" id="L844"> short cost2 = 0;</span>
-<span class="fc" id="L845"> short cost3 = 0;</span>
-<span class="fc" id="L846"> short cost4 = 0;</span>
-<span class="fc" id="L847"> short cost5 = 0;</span>
-
-<span class="fc bfc" id="L849" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
-<span class="fc" id="L850"> final int icv =
sfmap[i];</span>
-<span class="fc" id="L851"> cost0 += (short)
(len_0[icv] & mask);</span>
-<span class="fc" id="L852"> cost1 += (short)
(len_1[icv] & mask);</span>
-<span class="fc" id="L853"> cost2 += (short)
(len_2[icv] & mask);</span>
-<span class="fc" id="L854"> cost3 += (short)
(len_3[icv] & mask);</span>
-<span class="fc" id="L855"> cost4 += (short)
(len_4[icv] & mask);</span>
-<span class="fc" id="L856"> cost5 += (short)
(len_5[icv] & mask);</span>
+<span class="fc" id="L844"> short cost0 = 0;</span>
+<span class="fc" id="L845"> short cost1 = 0;</span>
+<span class="fc" id="L846"> short cost2 = 0;</span>
+<span class="fc" id="L847"> short cost3 = 0;</span>
+<span class="fc" id="L848"> short cost4 = 0;</span>
+<span class="fc" id="L849"> short cost5 = 0;</span>
+
+<span class="fc bfc" id="L851" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
+<span class="fc" id="L852"> final int icv =
sfmap[i];</span>
+<span class="fc" id="L853"> cost0 += (short)
(len_0[icv] & mask);</span>
+<span class="fc" id="L854"> cost1 += (short)
(len_1[icv] & mask);</span>
+<span class="fc" id="L855"> cost2 += (short)
(len_2[icv] & mask);</span>
+<span class="fc" id="L856"> cost3 += (short)
(len_3[icv] & mask);</span>
+<span class="fc" id="L857"> cost4 += (short)
(len_4[icv] & mask);</span>
+<span class="fc" id="L858"> cost5 += (short)
(len_5[icv] & mask);</span>
}
-<span class="fc" id="L859"> cost[0] = cost0;</span>
-<span class="fc" id="L860"> cost[1] = cost1;</span>
-<span class="fc" id="L861"> cost[2] = cost2;</span>
-<span class="fc" id="L862"> cost[3] = cost3;</span>
-<span class="fc" id="L863"> cost[4] = cost4;</span>
-<span class="fc" id="L864"> cost[5] = cost5;</span>
-
-<span class="fc" id="L866"> } else {</span>
-<span class="fc bfc" id="L867" title="All 2 branches covered.">
for (int t = nGroups; --t >= 0;) {</span>
-<span class="fc" id="L868"> cost[t] = 0;</span>
+<span class="fc" id="L861"> cost[0] = cost0;</span>
+<span class="fc" id="L862"> cost[1] = cost1;</span>
+<span class="fc" id="L863"> cost[2] = cost2;</span>
+<span class="fc" id="L864"> cost[3] = cost3;</span>
+<span class="fc" id="L865"> cost[4] = cost4;</span>
+<span class="fc" id="L866"> cost[5] = cost5;</span>
+
+<span class="fc" id="L868"> } else {</span>
+<span class="fc bfc" id="L869" title="All 2 branches covered.">
for (int t = nGroups; --t >= 0;) {</span>
+<span class="fc" id="L870"> cost[t] = 0;</span>
}
-<span class="fc bfc" id="L871" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
-<span class="fc" id="L872"> final int icv =
sfmap[i];</span>
-<span class="fc bfc" id="L873" title="All 2 branches covered.">
for (int t = nGroups; --t >= 0;) {</span>
-<span class="fc" id="L874"> cost[t] += (short)
(len[t][icv] & mask);</span>
+<span class="fc bfc" id="L873" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
+<span class="fc" id="L874"> final int icv =
sfmap[i];</span>
+<span class="fc bfc" id="L875" title="All 2 branches covered.">
for (int t = nGroups; --t >= 0;) {</span>
+<span class="fc" id="L876"> cost[t] += (short)
(len[t][icv] & mask);</span>
}
}
}
@@ -879,335 +881,330 @@ public class BZip2CompressorOutputStream
/*
* Find the coding table which is best for this group, and
record its identity in the selector table.
*/
-<span class="fc" id="L882"> int bt = -1;</span>
-<span class="fc bfc" id="L883" title="All 2 branches covered.">
for (int t = nGroups, bc = 999999999; --t >= 0;) {</span>
-<span class="fc" id="L884"> final int cost_t =
cost[t];</span>
-<span class="fc bfc" id="L885" title="All 2 branches covered.">
if (cost_t < bc) {</span>
-<span class="fc" id="L886"> bc = cost_t;</span>
-<span class="fc" id="L887"> bt = t;</span>
+<span class="fc" id="L884"> int bt = -1;</span>
+<span class="fc bfc" id="L885" title="All 2 branches covered.">
for (int t = nGroups, bc = 999999999; --t >= 0;) {</span>
+<span class="fc" id="L886"> final int cost_t =
cost[t];</span>
+<span class="fc bfc" id="L887" title="All 2 branches covered.">
if (cost_t < bc) {</span>
+<span class="fc" id="L888"> bc = cost_t;</span>
+<span class="fc" id="L889"> bt = t;</span>
}
-<span class="fc" id="L889"> }</span>
+<span class="fc" id="L891"> }</span>
-<span class="fc" id="L891"> fave[bt]++;</span>
-<span class="fc" id="L892"> selector[nSelectors] = (byte)
bt;</span>
-<span class="fc" id="L893"> nSelectors++;</span>
+<span class="fc" id="L893"> fave[bt]++;</span>
+<span class="fc" id="L894"> selector[nSelectors] = (byte)
bt;</span>
+<span class="fc" id="L895"> nSelectors++;</span>
/*
* Increment the symbol frequencies for the selected table.
*/
-<span class="fc" id="L898"> final int[] rfreq_bt =
rfreq[bt];</span>
-<span class="fc bfc" id="L899" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
-<span class="fc" id="L900"> rfreq_bt[sfmap[i]]++;</span>
+<span class="fc" id="L900"> final int[] rfreq_bt =
rfreq[bt];</span>
+<span class="fc bfc" id="L901" title="All 2 branches covered.">
for (int i = gs; i <= ge; i++) {</span>
+<span class="fc" id="L902"> rfreq_bt[sfmap[i]]++;</span>
}
-<span class="fc" id="L903"> gs = ge + 1;</span>
-<span class="fc" id="L904"> }</span>
+<span class="fc" id="L905"> gs = ge + 1;</span>
+<span class="fc" id="L906"> }</span>
/*
* Recompute the tables based on the accumulated frequencies.
*/
-<span class="fc bfc" id="L909" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
-<span class="fc" id="L910"> hbMakeCodeLengths(len[t], rfreq[t],
this.data, alphaSize, 20);</span>
+<span class="fc bfc" id="L911" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
+<span class="fc" id="L912"> hbMakeCodeLengths(len[t], rfreq[t],
this.data, alphaSize, 20);</span>
}
}
-<span class="fc" id="L914"> return nSelectors;</span>
+<span class="fc" id="L916"> return nSelectors;</span>
}
private void sendMTFValues2(final int nGroups, final int nSelectors) {
// assert (nGroups < 8) : nGroups;
-<span class="fc" id="L920"> final Data dataShadow = this.data;</span>
-<span class="fc" id="L921"> final byte[] pos =
dataShadow.sendMTFValues2_pos;</span>
+<span class="fc" id="L922"> final Data dataShadow = this.data;</span>
+<span class="fc" id="L923"> final byte[] pos =
dataShadow.sendMTFValues2_pos;</span>
-<span class="fc bfc" id="L923" title="All 2 branches covered."> for
(int i = nGroups; --i >= 0;) {</span>
-<span class="fc" id="L924"> pos[i] = (byte) i;</span>
+<span class="fc bfc" id="L925" title="All 2 branches covered."> for
(int i = nGroups; --i >= 0;) {</span>
+<span class="fc" id="L926"> pos[i] = (byte) i;</span>
}
-<span class="fc bfc" id="L927" title="All 2 branches covered."> for
(int i = 0; i < nSelectors; i++) {</span>
-<span class="fc" id="L928"> final byte ll_i =
dataShadow.selector[i];</span>
-<span class="fc" id="L929"> byte tmp = pos[0];</span>
-<span class="fc" id="L930"> int j = 0;</span>
+<span class="fc bfc" id="L929" title="All 2 branches covered."> for
(int i = 0; i < nSelectors; i++) {</span>
+<span class="fc" id="L930"> final byte ll_i =
dataShadow.selector[i];</span>
+<span class="fc" id="L931"> byte tmp = pos[0];</span>
+<span class="fc" id="L932"> int j = 0;</span>
-<span class="fc bfc" id="L932" title="All 2 branches covered.">
while (ll_i != tmp) {</span>
-<span class="fc" id="L933"> j++;</span>
-<span class="fc" id="L934"> final byte tmp2 = tmp;</span>
-<span class="fc" id="L935"> tmp = pos[j];</span>
-<span class="fc" id="L936"> pos[j] = tmp2;</span>
-<span class="fc" id="L937"> }</span>
+<span class="fc bfc" id="L934" title="All 2 branches covered.">
while (ll_i != tmp) {</span>
+<span class="fc" id="L935"> j++;</span>
+<span class="fc" id="L936"> final byte tmp2 = tmp;</span>
+<span class="fc" id="L937"> tmp = pos[j];</span>
+<span class="fc" id="L938"> pos[j] = tmp2;</span>
+<span class="fc" id="L939"> }</span>
-<span class="fc" id="L939"> pos[0] = tmp;</span>
-<span class="fc" id="L940"> dataShadow.selectorMtf[i] = (byte)
j;</span>
+<span class="fc" id="L941"> pos[0] = tmp;</span>
+<span class="fc" id="L942"> dataShadow.selectorMtf[i] = (byte)
j;</span>
}
-<span class="fc" id="L942"> }</span>
+<span class="fc" id="L944"> }</span>
private void sendMTFValues3(final int nGroups, final int alphaSize) {
-<span class="fc" id="L945"> final int[][] code =
this.data.sendMTFValues_code;</span>
-<span class="fc" id="L946"> final byte[][] len =
this.data.sendMTFValues_len;</span>
+<span class="fc" id="L947"> final int[][] code =
this.data.sendMTFValues_code;</span>
+<span class="fc" id="L948"> final byte[][] len =
this.data.sendMTFValues_len;</span>
-<span class="fc bfc" id="L948" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
-<span class="fc" id="L949"> int minLen = 32;</span>
-<span class="fc" id="L950"> int maxLen = 0;</span>
-<span class="fc" id="L951"> final byte[] len_t = len[t];</span>
-<span class="fc bfc" id="L952" title="All 2 branches covered."> for
(int i = alphaSize; --i >= 0;) {</span>
-<span class="fc" id="L953"> final int l = len_t[i] &
0xff;</span>
-<span class="fc bfc" id="L954" title="All 2 branches covered.">
if (l > maxLen) {</span>
-<span class="fc" id="L955"> maxLen = l;</span>
+<span class="fc bfc" id="L950" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
+<span class="fc" id="L951"> int minLen = 32;</span>
+<span class="fc" id="L952"> int maxLen = 0;</span>
+<span class="fc" id="L953"> final byte[] len_t = len[t];</span>
+<span class="fc bfc" id="L954" title="All 2 branches covered."> for
(int i = alphaSize; --i >= 0;) {</span>
+<span class="fc" id="L955"> final int l = len_t[i] &
0xff;</span>
+<span class="fc bfc" id="L956" title="All 2 branches covered.">
if (l > maxLen) {</span>
+<span class="fc" id="L957"> maxLen = l;</span>
}
-<span class="fc bfc" id="L957" title="All 2 branches covered.">
if (l < minLen) {</span>
-<span class="fc" id="L958"> minLen = l;</span>
+<span class="fc bfc" id="L959" title="All 2 branches covered.">
if (l < minLen) {</span>
+<span class="fc" id="L960"> minLen = l;</span>
}
-<span class="fc" id="L960"> }</span>
+<span class="fc" id="L962"> }</span>
// assert (maxLen <= 20) : maxLen;
// assert (minLen >= 1) : minLen;
-<span class="fc" id="L965"> hbAssignCodes(code[t], len[t], minLen,
maxLen, alphaSize);</span>
+<span class="fc" id="L967"> hbAssignCodes(code[t], len[t], minLen,
maxLen, alphaSize);</span>
}
-<span class="fc" id="L967"> }</span>
+<span class="fc" id="L969"> }</span>
private void sendMTFValues4() throws IOException {
-<span class="fc" id="L970"> final boolean[] inUse =
this.data.inUse;</span>
-<span class="fc" id="L971"> final boolean[] inUse16 =
this.data.sentMTFValues4_inUse16;</span>
+<span class="fc" id="L972"> final boolean[] inUse =
this.data.inUse;</span>
+<span class="fc" id="L973"> final boolean[] inUse16 =
this.data.sentMTFValues4_inUse16;</span>
-<span class="fc bfc" id="L973" title="All 2 branches covered."> for
(int i = 16; --i >= 0;) {</span>
-<span class="fc" id="L974"> inUse16[i] = false;</span>
-<span class="fc" id="L975"> final int i16 = i * 16;</span>
-<span class="fc bfc" id="L976" title="All 2 branches covered."> for
(int j = 16; --j >= 0;) {</span>
-<span class="fc bfc" id="L977" title="All 2 branches covered.">
if (inUse[i16 + j]) {</span>
-<span class="fc" id="L978"> inUse16[i] = true;</span>
-<span class="fc" id="L979"> break;</span>
+<span class="fc bfc" id="L975" title="All 2 branches covered."> for
(int i = 16; --i >= 0;) {</span>
+<span class="fc" id="L976"> inUse16[i] = false;</span>
+<span class="fc" id="L977"> final int i16 = i * 16;</span>
+<span class="fc bfc" id="L978" title="All 2 branches covered."> for
(int j = 16; --j >= 0;) {</span>
+<span class="fc bfc" id="L979" title="All 2 branches covered.">
if (inUse[i16 + j]) {</span>
+<span class="fc" id="L980"> inUse16[i] = true;</span>
+<span class="fc" id="L981"> break;</span>
}
}
-<span class="fc" id="L982"> }</span>
+<span class="fc" id="L984"> }</span>
-<span class="fc bfc" id="L984" title="All 2 branches covered."> for
(int i = 0; i < 16; i++) {</span>
-<span class="fc bfc" id="L985" title="All 2 branches covered.">
bsW(1, inUse16[i] ? 1 : 0);</span>
+<span class="fc bfc" id="L986" title="All 2 branches covered."> for
(int i = 0; i < 16; i++) {</span>
+<span class="fc bfc" id="L987" title="All 2 branches covered.">
bsW(1, inUse16[i] ? 1 : 0);</span>
}
-<span class="fc" id="L988"> final OutputStream outShadow =
this.out;</span>
-<span class="fc" id="L989"> int bsLiveShadow = this.bsLive;</span>
-<span class="fc" id="L990"> int bsBuffShadow = this.bsBuff;</span>
+<span class="fc" id="L990"> final OutputStream outShadow =
this.out;</span>
+<span class="fc" id="L991"> int bsLiveShadow = this.bsLive;</span>
+<span class="fc" id="L992"> int bsBuffShadow = this.bsBuff;</span>
-<span class="fc bfc" id="L992" title="All 2 branches covered."> for
(int i = 0; i < 16; i++) {</span>
-<span class="fc bfc" id="L993" title="All 2 branches covered."> if
(inUse16[i]) {</span>
-<span class="fc" id="L994"> final int i16 = i * 16;</span>
-<span class="fc bfc" id="L995" title="All 2 branches covered.">
for (int j = 0; j < 16; j++) {</span>
+<span class="fc bfc" id="L994" title="All 2 branches covered."> for
(int i = 0; i < 16; i++) {</span>
+<span class="fc bfc" id="L995" title="All 2 branches covered."> if
(inUse16[i]) {</span>
+<span class="fc" id="L996"> final int i16 = i * 16;</span>
+<span class="fc bfc" id="L997" title="All 2 branches covered.">
for (int j = 0; j < 16; j++) {</span>
// inlined: bsW(1, inUse[i16 + j] ? 1 : 0);
-<span class="fc bfc" id="L997" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L998">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
-<span class="fc" id="L999"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1000"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L999" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1000">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
+<span class="fc" id="L1001"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1002"> bsLiveShadow -= 8;</span>
}
-<span class="fc bfc" id="L1002" title="All 2 branches covered.">
if (inUse[i16 + j]) {</span>
-<span class="fc" id="L1003"> bsBuffShadow |= 1 <<
32 - bsLiveShadow - 1;</span>
+<span class="fc bfc" id="L1004" title="All 2 branches covered.">
if (inUse[i16 + j]) {</span>
+<span class="fc" id="L1005"> bsBuffShadow |= 1 <<
32 - bsLiveShadow - 1;</span>
}
-<span class="fc" id="L1005"> bsLiveShadow++;</span>
+<span class="fc" id="L1007"> bsLiveShadow++;</span>
}
}
}
-<span class="fc" id="L1010"> this.bsBuff = bsBuffShadow;</span>
-<span class="fc" id="L1011"> this.bsLive = bsLiveShadow;</span>
-<span class="fc" id="L1012"> }</span>
+<span class="fc" id="L1012"> this.bsBuff = bsBuffShadow;</span>
+<span class="fc" id="L1013"> this.bsLive = bsLiveShadow;</span>
+<span class="fc" id="L1014"> }</span>
private void sendMTFValues5(final int nGroups, final int nSelectors)
throws IOException {
-<span class="fc" id="L1015"> bsW(3, nGroups);</span>
-<span class="fc" id="L1016"> bsW(15, nSelectors);</span>
+<span class="fc" id="L1017"> bsW(3, nGroups);</span>
+<span class="fc" id="L1018"> bsW(15, nSelectors);</span>
-<span class="fc" id="L1018"> final OutputStream outShadow =
this.out;</span>
-<span class="fc" id="L1019"> final byte[] selectorMtf =
this.data.selectorMtf;</span>
+<span class="fc" id="L1020"> final OutputStream outShadow =
this.out;</span>
+<span class="fc" id="L1021"> final byte[] selectorMtf =
this.data.selectorMtf;</span>
-<span class="fc" id="L1021"> int bsLiveShadow = this.bsLive;</span>
-<span class="fc" id="L1022"> int bsBuffShadow = this.bsBuff;</span>
+<span class="fc" id="L1023"> int bsLiveShadow = this.bsLive;</span>
+<span class="fc" id="L1024"> int bsBuffShadow = this.bsBuff;</span>
-<span class="fc bfc" id="L1024" title="All 2 branches covered."> for
(int i = 0; i < nSelectors; i++) {</span>
-<span class="fc bfc" id="L1025" title="All 2 branches covered.">
for (int j = 0, hj = selectorMtf[i] & 0xff; j < hj; j++) {</span>
+<span class="fc bfc" id="L1026" title="All 2 branches covered."> for
(int i = 0; i < nSelectors; i++) {</span>
+<span class="fc bfc" id="L1027" title="All 2 branches covered.">
for (int j = 0, hj = selectorMtf[i] & 0xff; j < hj; j++) {</span>
// inlined: bsW(1, 1);
-<span class="fc bfc" id="L1027" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1028"> outShadow.write(bsBuffShadow
>> 24);</span>
-<span class="fc" id="L1029"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1030"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L1029" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1030"> outShadow.write(bsBuffShadow
>> 24);</span>
+<span class="fc" id="L1031"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1032"> bsLiveShadow -= 8;</span>
}
-<span class="fc" id="L1032"> bsBuffShadow |= 1 << 32 -
bsLiveShadow - 1;</span>
-<span class="fc" id="L1033"> bsLiveShadow++;</span>
+<span class="fc" id="L1034"> bsBuffShadow |= 1 << 32 -
bsLiveShadow - 1;</span>
+<span class="fc" id="L1035"> bsLiveShadow++;</span>
}
// inlined: bsW(1, 0);
-<span class="fc bfc" id="L1037" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1038"> outShadow.write(bsBuffShadow
>> 24);</span>
-<span class="fc" id="L1039"> bsBuffShadow <<= 8;</span>
-<span class="fc" id="L1040"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L1039" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1040"> outShadow.write(bsBuffShadow
>> 24);</span>
+<span class="fc" id="L1041"> bsBuffShadow <<= 8;</span>
+<span class="fc" id="L1042"> bsLiveShadow -= 8;</span>
}
// bsBuffShadow |= 0 << (32 - bsLiveShadow - 1);
-<span class="fc" id="L1043"> bsLiveShadow++;</span>
+<span class="fc" id="L1045"> bsLiveShadow++;</span>
}
-<span class="fc" id="L1046"> this.bsBuff = bsBuffShadow;</span>
-<span class="fc" id="L1047"> this.bsLive = bsLiveShadow;</span>
-<span class="fc" id="L1048"> }</span>
+<span class="fc" id="L1048"> this.bsBuff = bsBuffShadow;</span>
+<span class="fc" id="L1049"> this.bsLive = bsLiveShadow;</span>
+<span class="fc" id="L1050"> }</span>
private void sendMTFValues6(final int nGroups, final int alphaSize) throws
IOException {
-<span class="fc" id="L1051"> final byte[][] len =
this.data.sendMTFValues_len;</span>
-<span class="fc" id="L1052"> final OutputStream outShadow =
this.out;</span>
+<span class="fc" id="L1053"> final byte[][] len =
this.data.sendMTFValues_len;</span>
+<span class="fc" id="L1054"> final OutputStream outShadow =
this.out;</span>
-<span class="fc" id="L1054"> int bsLiveShadow = this.bsLive;</span>
-<span class="fc" id="L1055"> int bsBuffShadow = this.bsBuff;</span>
+<span class="fc" id="L1056"> int bsLiveShadow = this.bsLive;</span>
+<span class="fc" id="L1057"> int bsBuffShadow = this.bsBuff;</span>
-<span class="fc bfc" id="L1057" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
-<span class="fc" id="L1058"> final byte[] len_t = len[t];</span>
-<span class="fc" id="L1059"> int curr = len_t[0] & 0xff;</span>
+<span class="fc bfc" id="L1059" title="All 2 branches covered."> for
(int t = 0; t < nGroups; t++) {</span>
+<span class="fc" id="L1060"> final byte[] len_t = len[t];</span>
+<span class="fc" id="L1061"> int curr = len_t[0] & 0xff;</span>
// inlined: bsW(5, curr);
-<span class="fc bfc" id="L1062" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1063"> outShadow.write(bsBuffShadow
>> 24); // write 8-bit</span>
-<span class="fc" id="L1064"> bsBuffShadow <<= 8;</span>
-<span class="fc" id="L1065"> bsLiveShadow -= 8;</span>
- }
-<span class="fc" id="L1067"> bsBuffShadow |= curr << 32 -
bsLiveShadow - 5;</span>
-<span class="fc" id="L1068"> bsLiveShadow += 5;</span>
-
-<span class="fc bfc" id="L1070" title="All 2 branches covered.">
for (int i = 0; i < alphaSize; i++) {</span>
-<span class="fc" id="L1071"> final int lti = len_t[i] &
0xff;</span>
-<span class="fc bfc" id="L1072" title="All 2 branches covered.">
while (curr < lti) {</span>
+<span class="fc bfc" id="L1064" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1065"> outShadow.write(bsBuffShadow
>> 24); // write 8-bit</span>
+<span class="fc" id="L1066"> bsBuffShadow <<= 8;</span>
+<span class="fc" id="L1067"> bsLiveShadow -= 8;</span>
+ }
+<span class="fc" id="L1069"> bsBuffShadow |= curr << 32 -
bsLiveShadow - 5;</span>
+<span class="fc" id="L1070"> bsLiveShadow += 5;</span>
+
+<span class="fc bfc" id="L1072" title="All 2 branches covered.">
for (int i = 0; i < alphaSize; i++) {</span>
+<span class="fc" id="L1073"> final int lti = len_t[i] &
0xff;</span>
+<span class="fc bfc" id="L1074" title="All 2 branches covered.">
while (curr < lti) {</span>
// inlined: bsW(2, 2);
-<span class="fc bfc" id="L1074" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1075">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
-<span class="fc" id="L1076"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1077"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L1076" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1077">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
+<span class="fc" id="L1078"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1079"> bsLiveShadow -= 8;</span>
}
-<span class="fc" id="L1079"> bsBuffShadow |= 2 << 32
- bsLiveShadow - 2;</span>
-<span class="fc" id="L1080"> bsLiveShadow += 2;</span>
+<span class="fc" id="L1081"> bsBuffShadow |= 2 << 32
- bsLiveShadow - 2;</span>
+<span class="fc" id="L1082"> bsLiveShadow += 2;</span>
-<span class="fc" id="L1082"> curr++; /* 10 */</span>
+<span class="fc" id="L1084"> curr++; /* 10 */</span>
}
-<span class="fc bfc" id="L1085" title="All 2 branches covered.">
while (curr > lti) {</span>
+<span class="fc bfc" id="L1087" title="All 2 branches covered.">
while (curr > lti) {</span>
// inlined: bsW(2, 3);
-<span class="fc bfc" id="L1087" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1088">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
-<span class="fc" id="L1089"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1090"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L1089" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1090">
outShadow.write(bsBuffShadow >> 24); // write 8-bit</span>
+<span class="fc" id="L1091"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1092"> bsLiveShadow -= 8;</span>
}
-<span class="fc" id="L1092"> bsBuffShadow |= 3 << 32
- bsLiveShadow - 2;</span>
-<span class="fc" id="L1093"> bsLiveShadow += 2;</span>
+<span class="fc" id="L1094"> bsBuffShadow |= 3 << 32
- bsLiveShadow - 2;</span>
+<span class="fc" id="L1095"> bsLiveShadow += 2;</span>
-<span class="fc" id="L1095"> curr--; /* 11 */</span>
+<span class="fc" id="L1097"> curr--; /* 11 */</span>
}
// inlined: bsW(1, 0);
-<span class="fc bfc" id="L1099" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1100"> outShadow.write(bsBuffShadow
>> 24); // write 8-bit</span>
-<span class="fc" id="L1101"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1102"> bsLiveShadow -= 8;</span>
+<span class="fc bfc" id="L1101" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1102"> outShadow.write(bsBuffShadow
>> 24); // write 8-bit</span>
+<span class="fc" id="L1103"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1104"> bsLiveShadow -= 8;</span>
}
// bsBuffShadow |= 0 << (32 - bsLiveShadow - 1);
-<span class="fc" id="L1105"> bsLiveShadow++;</span>
+<span class="fc" id="L1107"> bsLiveShadow++;</span>
}
}
-<span class="fc" id="L1109"> this.bsBuff = bsBuffShadow;</span>
-<span class="fc" id="L1110"> this.bsLive = bsLiveShadow;</span>
-<span class="fc" id="L1111"> }</span>
+<span class="fc" id="L1111"> this.bsBuff = bsBuffShadow;</span>
+<span class="fc" id="L1112"> this.bsLive = bsLiveShadow;</span>
+<span class="fc" id="L1113"> }</span>
private void sendMTFValues7() throws IOException {
-<span class="fc" id="L1114"> final Data dataShadow = this.data;</span>
-<span class="fc" id="L1115"> final byte[][] len =
dataShadow.sendMTFValues_len;</span>
-<span class="fc" id="L1116"> final int[][] code =
dataShadow.sendMTFValues_code;</span>
-<span class="fc" id="L1117"> final OutputStream outShadow =
this.out;</span>
-<span class="fc" id="L1118"> final byte[] selector =
dataShadow.selector;</span>
-<span class="fc" id="L1119"> final char[] sfmap =
dataShadow.sfmap;</span>
-<span class="fc" id="L1120"> final int nMTFShadow = this.nMTF;</span>
-
-<span class="fc" id="L1122"> int selCtr = 0;</span>
-
-<span class="fc" id="L1124"> int bsLiveShadow = this.bsLive;</span>
-<span class="fc" id="L1125"> int bsBuffShadow = this.bsBuff;</span>
-
-<span class="fc bfc" id="L1127" title="All 2 branches covered."> for
(int gs = 0; gs < nMTFShadow;) {</span>
-<span class="fc" id="L1128"> final int ge = Math.min(gs + G_SIZE -
1, nMTFShadow - 1);</span>
-<span class="fc" id="L1129"> final int selector_selCtr =
selector[selCtr] & 0xff;</span>
-<span class="fc" id="L1130"> final int[] code_selCtr =
code[selector_selCtr];</span>
-<span class="fc" id="L1131"> final byte[] len_selCtr =
len[selector_selCtr];</span>
+<span class="fc" id="L1116"> final Data dataShadow = this.data;</span>
+<span class="fc" id="L1117"> final byte[][] len =
dataShadow.sendMTFValues_len;</span>
+<span class="fc" id="L1118"> final int[][] code =
dataShadow.sendMTFValues_code;</span>
+<span class="fc" id="L1119"> final OutputStream outShadow =
this.out;</span>
+<span class="fc" id="L1120"> final byte[] selector =
dataShadow.selector;</span>
+<span class="fc" id="L1121"> final char[] sfmap =
dataShadow.sfmap;</span>
+<span class="fc" id="L1122"> final int nMTFShadow = this.nMTF;</span>
+
+<span class="fc" id="L1124"> int selCtr = 0;</span>
+
+<span class="fc" id="L1126"> int bsLiveShadow = this.bsLive;</span>
+<span class="fc" id="L1127"> int bsBuffShadow = this.bsBuff;</span>
+
+<span class="fc bfc" id="L1129" title="All 2 branches covered."> for
(int gs = 0; gs < nMTFShadow;) {</span>
+<span class="fc" id="L1130"> final int ge = Math.min(gs + G_SIZE -
1, nMTFShadow - 1);</span>
+<span class="fc" id="L1131"> final int selector_selCtr =
selector[selCtr] & 0xff;</span>
+<span class="fc" id="L1132"> final int[] code_selCtr =
code[selector_selCtr];</span>
+<span class="fc" id="L1133"> final byte[] len_selCtr =
len[selector_selCtr];</span>
-<span class="fc bfc" id="L1133" title="All 2 branches covered.">
while (gs <= ge) {</span>
-<span class="fc" id="L1134"> final int sfmap_i =
sfmap[gs];</span>
+<span class="fc bfc" id="L1135" title="All 2 branches covered.">
while (gs <= ge) {</span>
+<span class="fc" id="L1136"> final int sfmap_i =
sfmap[gs];</span>
//
// inlined: bsW(len_selCtr[sfmap_i] & 0xff,
// code_selCtr[sfmap_i]);
//
-<span class="fc bfc" id="L1140" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
-<span class="fc" id="L1141"> outShadow.write(bsBuffShadow
>> 24);</span>
-<span class="fc" id="L1142"> bsBuffShadow <<=
8;</span>
-<span class="fc" id="L1143"> bsLiveShadow -= 8;</span>
- }
-<span class="fc" id="L1145"> final int n = len_selCtr[sfmap_i]
& 0xFF;</span>
-<span class="fc" id="L1146"> bsBuffShadow |=
code_selCtr[sfmap_i] << 32 - bsLiveShadow - n;</span>
-<span class="fc" id="L1147"> bsLiveShadow += n;</span>
-
-<span class="fc" id="L1149"> gs++;</span>
-<span class="fc" id="L1150"> }</span>
-
-<span class="fc" id="L1152"> gs = ge + 1;</span>
-<span class="fc" id="L1153"> selCtr++;</span>
-<span class="fc" id="L1154"> }</span>
-
-<span class="fc" id="L1156"> this.bsBuff = bsBuffShadow;</span>
-<span class="fc" id="L1157"> this.bsLive = bsLiveShadow;</span>
-<span class="fc" id="L1158"> }</span>
+<span class="fc bfc" id="L1142" title="All 2 branches covered.">
while (bsLiveShadow >= 8) {</span>
+<span class="fc" id="L1143"> outShadow.write(bsBuffShadow
>> 24);</span>
+<span class="fc" id="L1144"> bsBuffShadow <<=
8;</span>
+<span class="fc" id="L1145"> bsLiveShadow -= 8;</span>
+ }
+<span class="fc" id="L1147"> final int n = len_selCtr[sfmap_i]
& 0xFF;</span>
+<span class="fc" id="L1148"> bsBuffShadow |=
code_selCtr[sfmap_i] << 32 - bsLiveShadow - n;</span>
+<span class="fc" id="L1149"> bsLiveShadow += n;</span>
+
+<span class="fc" id="L1151"> gs++;</span>
+<span class="fc" id="L1152"> }</span>
+
+<span class="fc" id="L1154"> gs = ge + 1;</span>
+<span class="fc" id="L1155"> selCtr++;</span>
+<span class="fc" id="L1156"> }</span>
+
+<span class="fc" id="L1158"> this.bsBuff = bsBuffShadow;</span>
+<span class="fc" id="L1159"> this.bsLive = bsLiveShadow;</span>
+<span class="fc" id="L1160"> }</span>
@Override
public void write(final byte[] buf, int offs, final int len) throws
IOException {
-<span class="pc bpc" id="L1162" title="1 of 2 branches missed."> if
(offs < 0) {</span>
-<span class="nc" id="L1163"> throw new
IndexOutOfBoundsException("offs(" + offs + ") <
0.");</span>
- }
-<span class="pc bpc" id="L1165" title="1 of 2 branches missed."> if
(len < 0) {</span>
-<span class="nc" id="L1166"> throw new
IndexOutOfBoundsException("len(" + len + ") <
0.");</span>
+<span class="pc bpc" id="L1164" title="1 of 2 branches missed."> if
(offs < 0) {</span>
+<span class="nc" id="L1165"> throw new
IndexOutOfBoundsException("offs(" + offs + ") <
0.");</span>
}
-<span class="pc bpc" id="L1168" title="1 of 2 branches missed."> if
(offs + len > buf.length) {</span>
-<span class="nc" id="L1169"> throw new
IndexOutOfBoundsException("offs(" + offs + ") + len(" + len
+ ") > buf.length(" + buf.length + ").");</span>
+<span class="pc bpc" id="L1167" title="1 of 2 branches missed."> if
(len < 0) {</span>
+<span class="nc" id="L1168"> throw new
IndexOutOfBoundsException("len(" + len + ") <
0.");</span>
}
-<span class="pc bpc" id="L1171" title="1 of 2 branches missed."> if
(closed) {</span>
-<span class="nc" id="L1172"> throw new IOException("Stream
closed");</span>
+<span class="pc bpc" id="L1170" title="1 of 2 branches missed."> if
(offs + len > buf.length) {</span>
+<span class="nc" id="L1171"> throw new
IndexOutOfBoundsException("offs(" + offs + ") + len(" + len
+ ") > buf.length(" + buf.length + ").");</span>
}
-
-<span class="fc bfc" id="L1175" title="All 2 branches covered."> for
(final int hi = offs + len; offs < hi;) {</span>
-<span class="fc" id="L1176"> write0(buf[offs++]);</span>
+<span class="fc" id="L1173"> checkClosed();</span>
+<span class="fc bfc" id="L1174" title="All 2 branches covered."> for
(final int hi = offs + len; offs < hi;) {</span>
+<span class="fc" id="L1175"> write0(buf[offs++]);</span>
}
-<span class="fc" id="L1178"> }</span>
+<span class="fc" id="L1177"> }</span>
@Override
public void write(final int b) throws IOException {
-<span class="nc bnc" id="L1182" title="All 2 branches missed."> if
(closed) {</span>
-<span class="nc" id="L1183"> throw new
IOException("Closed");</span>
- }
-<span class="nc" id="L1185"> write0(b);</span>
-<span class="nc" id="L1186"> }</span>
+<span class="nc" id="L1181"> checkClosed();</span>
+<span class="nc" id="L1182"> write0(b);</span>
+<span class="nc" id="L1183"> }</span>
/**
* Keeps track of the last bytes written and implicitly performs
run-length encoding as the first step of the bzip2 algorithm.
*/
private void write0(int b) throws IOException {
-<span class="fc bfc" id="L1192" title="All 2 branches covered."> if
(this.currentChar != -1) {</span>
-<span class="fc" id="L1193"> b &= 0xff;</span>
-<span class="fc bfc" id="L1194" title="All 2 branches covered."> if
(this.currentChar == b) {</span>
-<span class="pc bpc" id="L1195" title="1 of 2 branches missed.">
if (++this.runLength > 254) {</span>
-<span class="nc" id="L1196"> writeRun();</span>
-<span class="nc" id="L1197"> this.currentChar = -1;</span>
-<span class="nc" id="L1198"> this.runLength = 0;</span>
+<span class="fc bfc" id="L1189" title="All 2 branches covered."> if
(this.currentChar != -1) {</span>
+<span class="fc" id="L1190"> b &= 0xff;</span>
+<span class="fc bfc" id="L1191" title="All 2 branches covered."> if
(this.currentChar == b) {</span>
+<span class="pc bpc" id="L1192" title="1 of 2 branches missed.">
if (++this.runLength > 254) {</span>
+<span class="nc" id="L1193"> writeRun();</span>
+<span class="nc" id="L1194"> this.currentChar = -1;</span>
+<span class="nc" id="L1195"> this.runLength = 0;</span>
}
// else nothing to do
} else {
-<span class="fc" id="L1202"> writeRun();</span>
-<span class="fc" id="L1203"> this.runLength = 1;</span>
-<span class="fc" id="L1204"> this.currentChar = b;</span>
+<span class="fc" id="L1199"> writeRun();</span>
+<span class="fc" id="L1200"> this.runLength = 1;</span>
+<span class="fc" id="L1201"> this.currentChar = b;</span>
}
} else {
-<span class="fc" id="L1207"> this.currentChar = b & 0xff;</span>
-<span class="fc" id="L1208"> this.runLength++;</span>
+<span class="fc" id="L1204"> this.currentChar = b & 0xff;</span>
+<span class="fc" id="L1205"> this.runLength++;</span>
}
-<span class="fc" id="L1210"> }</span>
+<span class="fc" id="L1207"> }</span>
/**
* Writes the current byte to the buffer, run-length encoding it if it has
been repeated at least four times (the first step RLEs sequences of four
@@ -1223,58 +1220,58 @@ public class BZip2CompressorOutputStream
* </p>
*/
private void writeRun() throws IOException {
-<span class="fc" id="L1226"> final int lastShadow = this.last;</span>
+<span class="fc" id="L1223"> final int lastShadow = this.last;</span>
-<span class="fc bfc" id="L1228" title="All 2 branches covered."> if
(lastShadow < this.allowableBlockSize) {</span>
-<span class="fc" id="L1229"> final int currentCharShadow =
this.currentChar;</span>
-<span class="fc" id="L1230"> final Data dataShadow =
this.data;</span>
-<span class="fc" id="L1231"> dataShadow.inUse[currentCharShadow] =
true;</span>
-<span class="fc" id="L1232"> final byte ch = (byte)
currentCharShadow;</span>
+<span class="fc bfc" id="L1225" title="All 2 branches covered."> if
(lastShadow < this.allowableBlockSize) {</span>
+<span class="fc" id="L1226"> final int currentCharShadow =
this.currentChar;</span>
+<span class="fc" id="L1227"> final Data dataShadow =
this.data;</span>
+<span class="fc" id="L1228"> dataShadow.inUse[currentCharShadow] =
true;</span>
+<span class="fc" id="L1229"> final byte ch = (byte)
currentCharShadow;</span>
-<span class="fc" id="L1234"> int runLengthShadow =
this.runLength;</span>
-<span class="fc" id="L1235"> this.crc.update(currentCharShadow,
runLengthShadow);</span>
+<span class="fc" id="L1231"> int runLengthShadow =
this.runLength;</span>
+<span class="fc" id="L1232"> this.crc.update(currentCharShadow,
runLengthShadow);</span>
-<span class="fc bfc" id="L1237" title="All 4 branches covered.">
switch (runLengthShadow) {</span>
+<span class="fc bfc" id="L1234" title="All 4 branches covered.">
switch (runLengthShadow) {</span>
case 1:
-<span class="fc" id="L1239"> dataShadow.block[lastShadow + 2] =
ch;</span>
-<span class="fc" id="L1240"> this.last = lastShadow + 1;</span>
-<span class="fc" id="L1241"> break;</span>
+<span class="fc" id="L1236"> dataShadow.block[lastShadow + 2] =
ch;</span>
+<span class="fc" id="L1237"> this.last = lastShadow + 1;</span>
+<span class="fc" id="L1238"> break;</span>
case 2:
-<span class="fc" id="L1244"> dataShadow.block[lastShadow + 2] =
ch;</span>
-<span class="fc" id="L1245"> dataShadow.block[lastShadow + 3] =
ch;</span>
-<span class="fc" id="L1246"> this.last = lastShadow + 2;</span>
-<span class="fc" id="L1247"> break;</span>
+<span class="fc" id="L1241"> dataShadow.block[lastShadow + 2] =
ch;</span>
+<span class="fc" id="L1242"> dataShadow.block[lastShadow + 3] =
ch;</span>
+<span class="fc" id="L1243"> this.last = lastShadow + 2;</span>
+<span class="fc" id="L1244"> break;</span>
case 3: {
-<span class="fc" id="L1250"> final byte[] block =
dataShadow.block;</span>
-<span class="fc" id="L1251"> block[lastShadow + 2] = ch;</span>
-<span class="fc" id="L1252"> block[lastShadow + 3] = ch;</span>
-<span class="fc" id="L1253"> block[lastShadow + 4] = ch;</span>
-<span class="fc" id="L1254"> this.last = lastShadow + 3;</span>
+<span class="fc" id="L1247"> final byte[] block =
dataShadow.block;</span>
+<span class="fc" id="L1248"> block[lastShadow + 2] = ch;</span>
+<span class="fc" id="L1249"> block[lastShadow + 3] = ch;</span>
+<span class="fc" id="L1250"> block[lastShadow + 4] = ch;</span>
+<span class="fc" id="L1251"> this.last = lastShadow + 3;</span>
}
-<span class="fc" id="L1256"> break;</span>
+<span class="fc" id="L1253"> break;</span>
default: {
-<span class="fc" id="L1259"> runLengthShadow -= 4;</span>
-<span class="fc" id="L1260"> dataShadow.inUse[runLengthShadow]
= true;</span>
-<span class="fc" id="L1261"> final byte[] block =
dataShadow.block;</span>
-<span class="fc" id="L1262"> block[lastShadow + 2] = ch;</span>
-<span class="fc" id="L1263"> block[lastShadow + 3] = ch;</span>
-<span class="fc" id="L1264"> block[lastShadow + 4] = ch;</span>
-<span class="fc" id="L1265"> block[lastShadow + 5] = ch;</span>
-<span class="fc" id="L1266"> block[lastShadow + 6] = (byte)
runLengthShadow;</span>
-<span class="fc" id="L1267"> this.last = lastShadow + 5;</span>
+<span class="fc" id="L1256"> runLengthShadow -= 4;</span>
+<span class="fc" id="L1257"> dataShadow.inUse[runLengthShadow]
= true;</span>
+<span class="fc" id="L1258"> final byte[] block =
dataShadow.block;</span>
+<span class="fc" id="L1259"> block[lastShadow + 2] = ch;</span>
+<span class="fc" id="L1260"> block[lastShadow + 3] = ch;</span>
+<span class="fc" id="L1261"> block[lastShadow + 4] = ch;</span>
+<span class="fc" id="L1262"> block[lastShadow + 5] = ch;</span>
+<span class="fc" id="L1263"> block[lastShadow + 6] = (byte)
runLengthShadow;</span>
+<span class="fc" id="L1264"> this.last = lastShadow + 5;</span>
}
break;
}
-<span class="fc" id="L1272"> } else {</span>
-<span class="fc" id="L1273"> endBlock();</span>
-<span class="fc" id="L1274"> initBlock();</span>
-<span class="fc" id="L1275"> writeRun();</span>
+<span class="fc" id="L1269"> } else {</span>
+<span class="fc" id="L1270"> endBlock();</span>
+<span class="fc" id="L1271"> initBlock();</span>
+<span class="fc" id="L1272"> writeRun();</span>
}
-<span class="fc" id="L1277"> }</span>
+<span class="fc" id="L1274"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a
href="http://www.jacoco.org/jacoco">JaCoCo</a>
0.8.12.202403310830</span></div></body></html>
\ No newline at end of file