BitInputStream.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>BitInputStream (Apache Commons Compress 1.13 API)</title>
  7. <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
  8. </head>
  9. <body>
  10. <script type="text/javascript"><!--
  11. try {
  12. if (location.href.indexOf('is-external=true') == -1) {
  13. parent.document.title="BitInputStream (Apache Commons Compress 1.13 API)";
  14. }
  15. }
  16. catch(err) {
  17. }
  18. //-->
  19. </script>
  20. <noscript>
  21. <div>JavaScript is disabled on your browser.</div>
  22. </noscript>
  23. <!-- ========= START OF TOP NAVBAR ======= -->
  24. <div class="topNav"><a name="navbar_top">
  25. <!-- -->
  26. </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
  27. <!-- -->
  28. </a>
  29. <ul class="navList" title="Navigation">
  30. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  31. <li><a href="package-summary.html">Package</a></li>
  32. <li class="navBarCell1Rev">Class</li>
  33. <li><a href="class-use/BitInputStream.html">Use</a></li>
  34. <li><a href="package-tree.html">Tree</a></li>
  35. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  36. <li><a href="../../../../../index-all.html">Index</a></li>
  37. <li><a href="../../../../../help-doc.html">Help</a></li>
  38. </ul>
  39. </div>
  40. <div class="subNav">
  41. <ul class="navList">
  42. <li><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html" title="class in org.apache.commons.compress.utils"><span class="strong">Prev Class</span></a></li>
  43. <li><a href="../../../../../org/apache/commons/compress/utils/BoundedInputStream.html" title="class in org.apache.commons.compress.utils"><span class="strong">Next Class</span></a></li>
  44. </ul>
  45. <ul class="navList">
  46. <li><a href="../../../../../index.html?org/apache/commons/compress/utils/BitInputStream.html" target="_top">Frames</a></li>
  47. <li><a href="BitInputStream.html" target="_top">No Frames</a></li>
  48. </ul>
  49. <ul class="navList" id="allclasses_navbar_top">
  50. <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
  51. </ul>
  52. <div>
  53. <script type="text/javascript"><!--
  54. allClassesLink = document.getElementById("allclasses_navbar_top");
  55. if(window==top) {
  56. allClassesLink.style.display = "block";
  57. }
  58. else {
  59. allClassesLink.style.display = "none";
  60. }
  61. //-->
  62. </script>
  63. </div>
  64. <div>
  65. <ul class="subNavList">
  66. <li>Summary:&nbsp;</li>
  67. <li>Nested&nbsp;|&nbsp;</li>
  68. <li>Field&nbsp;|&nbsp;</li>
  69. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  70. <li><a href="#method_summary">Method</a></li>
  71. </ul>
  72. <ul class="subNavList">
  73. <li>Detail:&nbsp;</li>
  74. <li>Field&nbsp;|&nbsp;</li>
  75. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  76. <li><a href="#method_detail">Method</a></li>
  77. </ul>
  78. </div>
  79. <a name="skip-navbar_top">
  80. <!-- -->
  81. </a></div>
  82. <!-- ========= END OF TOP NAVBAR ========= -->
  83. <!-- ======== START OF CLASS DATA ======== -->
  84. <div class="header">
  85. <div class="subTitle">org.apache.commons.compress.utils</div>
  86. <h2 title="Class BitInputStream" class="title">Class BitInputStream</h2>
  87. </div>
  88. <div class="contentContainer">
  89. <ul class="inheritance">
  90. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  91. <li>
  92. <ul class="inheritance">
  93. <li>org.apache.commons.compress.utils.BitInputStream</li>
  94. </ul>
  95. </li>
  96. </ul>
  97. <div class="description">
  98. <ul class="blockList">
  99. <li class="blockList">
  100. <dl>
  101. <dt>All Implemented Interfaces:</dt>
  102. <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
  103. </dl>
  104. <hr>
  105. <br>
  106. <pre>public class <a href="../../../../../src-html/org/apache/commons/compress/utils/BitInputStream.html#line.31">BitInputStream</a>
  107. extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
  108. implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></pre>
  109. <div class="block">Reads bits from an InputStream.</div>
  110. <dl><dt><span class="strong">Since:</span></dt>
  111. <dd>1.10</dd>
  112. <dt><span class="strong">This class is not thread-safe</span></dt>
  113. <dd></dd></dl>
  114. </li>
  115. </ul>
  116. </div>
  117. <div class="summary">
  118. <ul class="blockList">
  119. <li class="blockList">
  120. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  121. <ul class="blockList">
  122. <li class="blockList"><a name="constructor_summary">
  123. <!-- -->
  124. </a>
  125. <h3>Constructor Summary</h3>
  126. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  127. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  128. <tr>
  129. <th class="colOne" scope="col">Constructor and Description</th>
  130. </tr>
  131. <tr class="altColor">
  132. <td class="colOne"><code><strong><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#BitInputStream(java.io.InputStream,%20java.nio.ByteOrder)">BitInputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;in,
  133. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/ByteOrder.html?is-external=true" title="class or interface in java.nio">ByteOrder</a>&nbsp;byteOrder)</code>
  134. <div class="block">Constructor taking an InputStream and its bit arrangement.</div>
  135. </td>
  136. </tr>
  137. </table>
  138. </li>
  139. </ul>
  140. <!-- ========== METHOD SUMMARY =========== -->
  141. <ul class="blockList">
  142. <li class="blockList"><a name="method_summary">
  143. <!-- -->
  144. </a>
  145. <h3>Method Summary</h3>
  146. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  147. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  148. <tr>
  149. <th class="colFirst" scope="col">Modifier and Type</th>
  150. <th class="colLast" scope="col">Method and Description</th>
  151. </tr>
  152. <tr class="altColor">
  153. <td class="colFirst"><code>void</code></td>
  154. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#clearBitCache()">clearBitCache</a></strong>()</code>
  155. <div class="block">Clears the cache of bits that have been read from the
  156. underlying stream but not yet provided via <a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#readBits(int)"><code>readBits(int)</code></a>.</div>
  157. </td>
  158. </tr>
  159. <tr class="rowColor">
  160. <td class="colFirst"><code>void</code></td>
  161. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#close()">close</a></strong>()</code>&nbsp;</td>
  162. </tr>
  163. <tr class="altColor">
  164. <td class="colFirst"><code>long</code></td>
  165. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#readBits(int)">readBits</a></strong>(int&nbsp;count)</code>
  166. <div class="block">Returns at most 63 bits read from the underlying stream.</div>
  167. </td>
  168. </tr>
  169. </table>
  170. <ul class="blockList">
  171. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  172. <!-- -->
  173. </a>
  174. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  175. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
  176. </ul>
  177. </li>
  178. </ul>
  179. </li>
  180. </ul>
  181. </div>
  182. <div class="details">
  183. <ul class="blockList">
  184. <li class="blockList">
  185. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  186. <ul class="blockList">
  187. <li class="blockList"><a name="constructor_detail">
  188. <!-- -->
  189. </a>
  190. <h3>Constructor Detail</h3>
  191. <a name="BitInputStream(java.io.InputStream, java.nio.ByteOrder)">
  192. <!-- -->
  193. </a>
  194. <ul class="blockListLast">
  195. <li class="blockList">
  196. <h4>BitInputStream</h4>
  197. <pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/BitInputStream.html#line.52">BitInputStream</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;in,
  198. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/ByteOrder.html?is-external=true" title="class or interface in java.nio">ByteOrder</a>&nbsp;byteOrder)</pre>
  199. <div class="block">Constructor taking an InputStream and its bit arrangement.</div>
  200. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - the InputStream</dd><dd><code>byteOrder</code> - the bit arrangement across byte boundaries,
  201. either BIG_ENDIAN (aaaaabbb bb000000) or LITTLE_ENDIAN (bbbaaaaa 000000bb)</dd></dl>
  202. </li>
  203. </ul>
  204. </li>
  205. </ul>
  206. <!-- ============ METHOD DETAIL ========== -->
  207. <ul class="blockList">
  208. <li class="blockList"><a name="method_detail">
  209. <!-- -->
  210. </a>
  211. <h3>Method Detail</h3>
  212. <a name="close()">
  213. <!-- -->
  214. </a>
  215. <ul class="blockList">
  216. <li class="blockList">
  217. <h4>close</h4>
  218. <pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/BitInputStream.html#line.58">close</a>()
  219. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  220. <dl>
  221. <dt><strong>Specified by:</strong></dt>
  222. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
  223. <dt><strong>Specified by:</strong></dt>
  224. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true#close()" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
  225. <dt><span class="strong">Throws:</span></dt>
  226. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd></dl>
  227. </li>
  228. </ul>
  229. <a name="clearBitCache()">
  230. <!-- -->
  231. </a>
  232. <ul class="blockList">
  233. <li class="blockList">
  234. <h4>clearBitCache</h4>
  235. <pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/BitInputStream.html#line.66">clearBitCache</a>()</pre>
  236. <div class="block">Clears the cache of bits that have been read from the
  237. underlying stream but not yet provided via <a href="../../../../../org/apache/commons/compress/utils/BitInputStream.html#readBits(int)"><code>readBits(int)</code></a>.</div>
  238. </li>
  239. </ul>
  240. <a name="readBits(int)">
  241. <!-- -->
  242. </a>
  243. <ul class="blockListLast">
  244. <li class="blockList">
  245. <h4>readBits</h4>
  246. <pre>public&nbsp;long&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/utils/BitInputStream.html#line.81">readBits</a>(int&nbsp;count)
  247. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  248. <div class="block">Returns at most 63 bits read from the underlying stream.</div>
  249. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the number of bits to read, must be a positive
  250. number not bigger than 63.</dd>
  251. <dt><span class="strong">Returns:</span></dt><dd>the bits concatenated as a long using the stream's byte order.
  252. -1 if the end of the underlying stream has been reached before reading
  253. the requested number of bits</dd>
  254. <dt><span class="strong">Throws:</span></dt>
  255. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on error</dd></dl>
  256. </li>
  257. </ul>
  258. </li>
  259. </ul>
  260. </li>
  261. </ul>
  262. </div>
  263. </div>
  264. <!-- ========= END OF CLASS DATA ========= -->
  265. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  266. <div class="bottomNav"><a name="navbar_bottom">
  267. <!-- -->
  268. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  269. <!-- -->
  270. </a>
  271. <ul class="navList" title="Navigation">
  272. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  273. <li><a href="package-summary.html">Package</a></li>
  274. <li class="navBarCell1Rev">Class</li>
  275. <li><a href="class-use/BitInputStream.html">Use</a></li>
  276. <li><a href="package-tree.html">Tree</a></li>
  277. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  278. <li><a href="../../../../../index-all.html">Index</a></li>
  279. <li><a href="../../../../../help-doc.html">Help</a></li>
  280. </ul>
  281. </div>
  282. <div class="subNav">
  283. <ul class="navList">
  284. <li><a href="../../../../../org/apache/commons/compress/utils/ArchiveUtils.html" title="class in org.apache.commons.compress.utils"><span class="strong">Prev Class</span></a></li>
  285. <li><a href="../../../../../org/apache/commons/compress/utils/BoundedInputStream.html" title="class in org.apache.commons.compress.utils"><span class="strong">Next Class</span></a></li>
  286. </ul>
  287. <ul class="navList">
  288. <li><a href="../../../../../index.html?org/apache/commons/compress/utils/BitInputStream.html" target="_top">Frames</a></li>
  289. <li><a href="BitInputStream.html" target="_top">No Frames</a></li>
  290. </ul>
  291. <ul class="navList" id="allclasses_navbar_bottom">
  292. <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
  293. </ul>
  294. <div>
  295. <script type="text/javascript"><!--
  296. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  297. if(window==top) {
  298. allClassesLink.style.display = "block";
  299. }
  300. else {
  301. allClassesLink.style.display = "none";
  302. }
  303. //-->
  304. </script>
  305. </div>
  306. <div>
  307. <ul class="subNavList">
  308. <li>Summary:&nbsp;</li>
  309. <li>Nested&nbsp;|&nbsp;</li>
  310. <li>Field&nbsp;|&nbsp;</li>
  311. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  312. <li><a href="#method_summary">Method</a></li>
  313. </ul>
  314. <ul class="subNavList">
  315. <li>Detail:&nbsp;</li>
  316. <li>Field&nbsp;|&nbsp;</li>
  317. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  318. <li><a href="#method_detail">Method</a></li>
  319. </ul>
  320. </div>
  321. <a name="skip-navbar_bottom">
  322. <!-- -->
  323. </a></div>
  324. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  325. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  326. </body>
  327. </html>