????

Your IP : 216.73.216.152


Current Path : /opt/ant/manual/api/org/apache/tools/bzip2/
Upload File :
Current File : //opt/ant/manual/api/org/apache/tools/bzip2/CBZip2OutputStream.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_03) on Tue May 22 06:24:55 CEST 2012 -->
<title>CBZip2OutputStream (Apache Ant API)</title>
<meta name="date" content="2012-05-22">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="CBZip2OutputStream (Apache Ant API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/tools/bzip2/CBZip2InputStream.html" title="class in org.apache.tools.bzip2"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/tools/bzip2/CBZip2OutputStream.html" target="_top">Frames</a></li>
<li><a href="CBZip2OutputStream.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.tools.bzip2</div>
<h2 title="Class CBZip2OutputStream" class="title">Class CBZip2OutputStream</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.io.OutputStream</li>
<li>
<ul class="inheritance">
<li>org.apache.tools.bzip2.CBZip2OutputStream</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html" title="interface in org.apache.tools.bzip2">BZip2Constants</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">CBZip2OutputStream</span>
extends java.io.OutputStream
implements <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html" title="interface in org.apache.tools.bzip2">BZip2Constants</a></pre>
<div class="block">An output stream that compresses into the BZip2 format (without the file
 header chars) into another stream.

 <p>
 The compression requires large amounts of memory. Thus you should call the
 <a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#close()"><code>close()</code></a> method as soon as possible, to force
 <tt>CBZip2OutputStream</tt> to release the allocated memory.
 </p>

 <p> You can shrink the amount of allocated memory and maybe raise
 the compression speed by choosing a lower blocksize, which in turn
 may cause a lower compression ratio. You can avoid unnecessary
 memory allocation by avoiding using a blocksize which is bigger
 than the size of the input.  </p>

 <p> You can compute the memory usage for compressing by the
 following formula: </p>

 <pre>
 &lt;code&gt;400k + (9 * blocksize)&lt;/code&gt;.
 </pre>

 <p> To get the memory required for decompression by <a href="../../../../org/apache/tools/bzip2/CBZip2InputStream.html" title="class in org.apache.tools.bzip2"><code>CBZip2InputStream</code></a> use </p>

 <pre>
 &lt;code&gt;65k + (5 * blocksize)&lt;/code&gt;.
 </pre>

 <table width="100%" border="1">
 <colgroup> <col width="33%" /> <col width="33%" /> <col width="33%" />
 </colgroup>
 <tr>
 <th colspan="3">Memory usage by blocksize</th>
 </tr>
 <tr>
 <th align="right">Blocksize</th> <th align="right">Compression<br>
 memory usage</th> <th align="right">Decompression<br>
 memory usage</th>
 </tr>
 <tr>
 <td align="right">100k</td>
 <td align="right">1300k</td>
 <td align="right">565k</td>
 </tr>
 <tr>
 <td align="right">200k</td>
 <td align="right">2200k</td>
 <td align="right">1065k</td>
 </tr>
 <tr>
 <td align="right">300k</td>
 <td align="right">3100k</td>
 <td align="right">1565k</td>
 </tr>
 <tr>
 <td align="right">400k</td>
 <td align="right">4000k</td>
 <td align="right">2065k</td>
 </tr>
 <tr>
 <td align="right">500k</td>
 <td align="right">4900k</td>
 <td align="right">2565k</td>
 </tr>
 <tr>
 <td align="right">600k</td>
 <td align="right">5800k</td>
 <td align="right">3065k</td>
 </tr>
 <tr>
 <td align="right">700k</td>
 <td align="right">6700k</td>
 <td align="right">3565k</td>
 </tr>
 <tr>
 <td align="right">800k</td>
 <td align="right">7600k</td>
 <td align="right">4065k</td>
 </tr>
 <tr>
 <td align="right">900k</td>
 <td align="right">8500k</td>
 <td align="right">4565k</td>
 </tr>
 </table>

 <p>
 For decompression <tt>CBZip2InputStream</tt> allocates less memory if the
 bzipped input is smaller than one block.
 </p>

 <p>
 Instances of this class are not threadsafe.
 </p>

 <p>
 TODO: Update to BZip2 1.0.1
 </p></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#CLEARMASK">CLEARMASK</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#DEPTH_THRESH">DEPTH_THRESH</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#GREATER_ICOST">GREATER_ICOST</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#LESSER_ICOST">LESSER_ICOST</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MAX_BLOCKSIZE">MAX_BLOCKSIZE</a></strong></code>
<div class="block">The maximum supported blocksize <tt> == 9</tt>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MIN_BLOCKSIZE">MIN_BLOCKSIZE</a></strong></code>
<div class="block">The minimum supported blocksize <tt> == 1</tt>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#QSORT_STACK_SIZE">QSORT_STACK_SIZE</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#SETMASK">SETMASK</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#SMALL_THRESH">SMALL_THRESH</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#WORK_FACTOR">WORK_FACTOR</a></strong></code>
<div class="block">This constant is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.tools.bzip2.BZip2Constants">
<!--   -->
</a>
<h3>Fields inherited from interface&nbsp;org.apache.tools.bzip2.<a href="../../../../org/apache/tools/bzip2/BZip2Constants.html" title="interface in org.apache.tools.bzip2">BZip2Constants</a></h3>
<code><a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#baseBlockSize">baseBlockSize</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#G_SIZE">G_SIZE</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#MAX_ALPHA_SIZE">MAX_ALPHA_SIZE</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#MAX_CODE_LEN">MAX_CODE_LEN</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#MAX_SELECTORS">MAX_SELECTORS</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#N_GROUPS">N_GROUPS</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#N_ITERS">N_ITERS</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#NUM_OVERSHOOT_BYTES">NUM_OVERSHOOT_BYTES</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#rNums">rNums</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#RUNA">RUNA</a>, <a href="../../../../org/apache/tools/bzip2/BZip2Constants.html#RUNB">RUNB</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#CBZip2OutputStream(java.io.OutputStream)">CBZip2OutputStream</a></strong>(java.io.OutputStream&nbsp;out)</code>
<div class="block">Constructs a new <tt>CBZip2OutputStream</tt> with a blocksize of 900k.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#CBZip2OutputStream(java.io.OutputStream, int)">CBZip2OutputStream</a></strong>(java.io.OutputStream&nbsp;out,
                  int&nbsp;blockSize)</code>
<div class="block">Constructs a new <tt>CBZip2OutputStream</tt> with specified blocksize.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#chooseBlockSize(long)">chooseBlockSize</a></strong>(long&nbsp;inputLength)</code>
<div class="block">Chooses a blocksize based on the given length of the data to compress.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#close()">close</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#finalize()">finalize</a></strong>()</code>
<div class="block">Overriden to close the stream.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#finish()">finish</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#flush()">flush</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#getBlockSize()">getBlockSize</a></strong>()</code>
<div class="block">Returns the blocksize parameter specified at construction time.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#hbMakeCodeLengths(char[], int[], int, int)">hbMakeCodeLengths</a></strong>(char[]&nbsp;len,
                 int[]&nbsp;freq,
                 int&nbsp;alphaSize,
                 int&nbsp;maxLen)</code>
<div class="block">This method is accessible by subclasses for historical
 purposes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#write(byte[], int, int)">write</a></strong>(byte[]&nbsp;buf,
     int&nbsp;offs,
     int&nbsp;len)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#write(int)">write</a></strong>(int&nbsp;b)</code></td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.io.OutputStream">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.io.OutputStream</h3>
<code>write</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="MIN_BLOCKSIZE">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MIN_BLOCKSIZE</h4>
<pre>public static final&nbsp;int MIN_BLOCKSIZE</pre>
<div class="block">The minimum supported blocksize <tt> == 1</tt>.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.MIN_BLOCKSIZE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="MAX_BLOCKSIZE">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MAX_BLOCKSIZE</h4>
<pre>public static final&nbsp;int MAX_BLOCKSIZE</pre>
<div class="block">The maximum supported blocksize <tt> == 9</tt>.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.MAX_BLOCKSIZE">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="SETMASK">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SETMASK</h4>
<pre>protected static final&nbsp;int SETMASK</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.SETMASK">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="CLEARMASK">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CLEARMASK</h4>
<pre>protected static final&nbsp;int CLEARMASK</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.CLEARMASK">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="GREATER_ICOST">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>GREATER_ICOST</h4>
<pre>protected static final&nbsp;int GREATER_ICOST</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.GREATER_ICOST">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="LESSER_ICOST">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LESSER_ICOST</h4>
<pre>protected static final&nbsp;int LESSER_ICOST</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.LESSER_ICOST">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="SMALL_THRESH">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SMALL_THRESH</h4>
<pre>protected static final&nbsp;int SMALL_THRESH</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.SMALL_THRESH">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="DEPTH_THRESH">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEPTH_THRESH</h4>
<pre>protected static final&nbsp;int DEPTH_THRESH</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.DEPTH_THRESH">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="WORK_FACTOR">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>WORK_FACTOR</h4>
<pre>protected static final&nbsp;int WORK_FACTOR</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.WORK_FACTOR">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="QSORT_STACK_SIZE">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>QSORT_STACK_SIZE</h4>
<pre>protected static final&nbsp;int QSORT_STACK_SIZE</pre>
<div class="block">This constant is accessible by subclasses for historical
 purposes. If you don't know what it means then you don't need
 it.
 <p> If you are ever unlucky/improbable enough to get a stack
 overflow whilst sorting, increase the following constant and
 try again. In practice I have never seen the stack go above 27
 elems, so the following limit seems very generous.  </p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.tools.bzip2.CBZip2OutputStream.QSORT_STACK_SIZE">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="CBZip2OutputStream(java.io.OutputStream)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CBZip2OutputStream</h4>
<pre>public&nbsp;CBZip2OutputStream(java.io.OutputStream&nbsp;out)
                   throws java.io.IOException</pre>
<div class="block">Constructs a new <tt>CBZip2OutputStream</tt> with a blocksize of 900k.

 <p>
 <b>Attention: </b>The caller is responsible to write the two BZip2 magic
 bytes <tt>"BZ"</tt> to the specified stream prior to calling this
 constructor.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - *
            the destination stream.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if an I/O error occurs in the specified stream.</dd>
<dd><code>java.lang.NullPointerException</code> - if <code>out == null</code>.</dd></dl>
</li>
</ul>
<a name="CBZip2OutputStream(java.io.OutputStream, int)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CBZip2OutputStream</h4>
<pre>public&nbsp;CBZip2OutputStream(java.io.OutputStream&nbsp;out,
                  int&nbsp;blockSize)
                   throws java.io.IOException</pre>
<div class="block">Constructs a new <tt>CBZip2OutputStream</tt> with specified blocksize.

 <p>
 <b>Attention: </b>The caller is responsible to write the two BZip2 magic
 bytes <tt>"BZ"</tt> to the specified stream prior to calling this
 constructor.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - the destination stream.</dd><dd><code>blockSize</code> - the blockSize as 100k units.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if an I/O error occurs in the specified stream.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if <code>(blockSize < 1) || (blockSize > 9)</code>.</dd>
<dd><code>java.lang.NullPointerException</code> - if <code>out == null</code>.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MIN_BLOCKSIZE"><code>MIN_BLOCKSIZE</code></a>, 
<a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MAX_BLOCKSIZE"><code>MAX_BLOCKSIZE</code></a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="hbMakeCodeLengths(char[], int[], int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hbMakeCodeLengths</h4>
<pre>protected static&nbsp;void&nbsp;hbMakeCodeLengths(char[]&nbsp;len,
                     int[]&nbsp;freq,
                     int&nbsp;alphaSize,
                     int&nbsp;maxLen)</pre>
<div class="block">This method is accessible by subclasses for historical
 purposes. If you don't know what it does then you don't need
 it.</div>
</li>
</ul>
<a name="chooseBlockSize(long)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chooseBlockSize</h4>
<pre>public static&nbsp;int&nbsp;chooseBlockSize(long&nbsp;inputLength)</pre>
<div class="block">Chooses a blocksize based on the given length of the data to compress.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>inputLength</code> - The length of the data which will be compressed by
            <tt>CBZip2OutputStream</tt>.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The blocksize, between <a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MIN_BLOCKSIZE"><code>MIN_BLOCKSIZE</code></a> and
         <a href="../../../../org/apache/tools/bzip2/CBZip2OutputStream.html#MAX_BLOCKSIZE"><code>MAX_BLOCKSIZE</code></a> both inclusive. For a negative
         <tt>inputLength</tt> this method returns <tt>MAX_BLOCKSIZE</tt>
         always.</dd></dl>
</li>
</ul>
<a name="write(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;void&nbsp;write(int&nbsp;b)
           throws java.io.IOException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>write</code>&nbsp;in class&nbsp;<code>java.io.OutputStream</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="finalize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finalize</h4>
<pre>protected&nbsp;void&nbsp;finalize()
                 throws java.lang.Throwable</pre>
<div class="block">Overriden to close the stream.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.Throwable</code></dd></dl>
</li>
</ul>
<a name="finish()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finish</h4>
<pre>public&nbsp;void&nbsp;finish()
            throws java.io.IOException</pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="close()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>public&nbsp;void&nbsp;close()
           throws java.io.IOException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>
<dt><strong>Specified by:</strong></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code>close</code>&nbsp;in class&nbsp;<code>java.io.OutputStream</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="flush()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>flush</h4>
<pre>public&nbsp;void&nbsp;flush()
           throws java.io.IOException</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code>flush</code>&nbsp;in interface&nbsp;<code>java.io.Flushable</code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code>flush</code>&nbsp;in class&nbsp;<code>java.io.OutputStream</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="getBlockSize()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBlockSize</h4>
<pre>public final&nbsp;int&nbsp;getBlockSize()</pre>
<div class="block">Returns the blocksize parameter specified at construction time.</div>
</li>
</ul>
<a name="write(byte[], int, int)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;void&nbsp;write(byte[]&nbsp;buf,
         int&nbsp;offs,
         int&nbsp;len)
           throws java.io.IOException</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>write</code>&nbsp;in class&nbsp;<code>java.io.OutputStream</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/tools/bzip2/CBZip2InputStream.html" title="class in org.apache.tools.bzip2"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/tools/bzip2/CBZip2OutputStream.html" target="_top">Frames</a></li>
<li><a href="CBZip2OutputStream.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>