NullInputStream.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  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. <!-- Generated by javadoc -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <title>NullInputStream (Apache Commons IO 2.6 API)</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="NullInputStream (Apache Commons IO 2.6 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10};
  22. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/NullInputStream.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../../../../../index-all.html">Index</a></li>
  47. <li><a href="../../../../../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../../../../../org/apache/commons/io/input/MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../../../../../org/apache/commons/io/input/NullReader.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../../../../../index.html?org/apache/commons/io/input/NullInputStream.html" target="_top">Frames</a></li>
  57. <li><a href="NullInputStream.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li>Field&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li>Field&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">org.apache.commons.io.input</div>
  96. <h2 title="Class NullInputStream" class="title">Class NullInputStream</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <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>
  101. <li>
  102. <ul class="inheritance">
  103. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">java.io.InputStream</a></li>
  104. <li>
  105. <ul class="inheritance">
  106. <li>org.apache.commons.io.input.NullInputStream</li>
  107. </ul>
  108. </li>
  109. </ul>
  110. </li>
  111. </ul>
  112. <div class="description">
  113. <ul class="blockList">
  114. <li class="blockList">
  115. <dl>
  116. <dt>All Implemented Interfaces:</dt>
  117. <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>
  118. </dl>
  119. <hr>
  120. <br>
  121. <pre>public class <span class="typeNameLabel">NullInputStream</span>
  122. extends <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></pre>
  123. <div class="block">A functional, light weight <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> that emulates
  124. a stream of a specified size.
  125. <p>
  126. This implementation provides a light weight
  127. object for testing with an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a>
  128. where the contents don't matter.
  129. <p>
  130. One use case would be for testing the handling of
  131. large <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> as it can emulate that
  132. scenario without the overhead of actually processing
  133. large numbers of bytes - significantly speeding up
  134. test execution times.
  135. <p>
  136. This implementation returns zero from the method that
  137. reads a byte and leaves the array unchanged in the read
  138. methods that are passed a byte array.
  139. If alternative data is required the <code>processByte()</code> and
  140. <code>processBytes()</code> methods can be implemented to generate
  141. data, for example:
  142. <pre>
  143. public class TestInputStream extends NullInputStream {
  144. public TestInputStream(int size) {
  145. super(size);
  146. }
  147. protected int processByte() {
  148. return ... // return required value here
  149. }
  150. protected void processBytes(byte[] bytes, int offset, int length) {
  151. for (int i = offset; i &lt; length; i++) {
  152. bytes[i] = ... // set array value here
  153. }
  154. }
  155. }
  156. </pre></div>
  157. <dl>
  158. <dt><span class="simpleTagLabel">Since:</span></dt>
  159. <dd>1.3</dd>
  160. <dt><span class="simpleTagLabel">Version:</span></dt>
  161. <dd>$Id$</dd>
  162. </dl>
  163. </li>
  164. </ul>
  165. </div>
  166. <div class="summary">
  167. <ul class="blockList">
  168. <li class="blockList">
  169. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  170. <ul class="blockList">
  171. <li class="blockList"><a name="constructor.summary">
  172. <!-- -->
  173. </a>
  174. <h3>Constructor Summary</h3>
  175. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  176. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  177. <tr>
  178. <th class="colOne" scope="col">Constructor and Description</th>
  179. </tr>
  180. <tr class="altColor">
  181. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#NullInputStream-long-">NullInputStream</a></span>(long&nbsp;size)</code>
  182. <div class="block">Create an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> that emulates a specified size
  183. which supports marking and does not throw EOFException.</div>
  184. </td>
  185. </tr>
  186. <tr class="rowColor">
  187. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#NullInputStream-long-boolean-boolean-">NullInputStream</a></span>(long&nbsp;size,
  188. boolean&nbsp;markSupported,
  189. boolean&nbsp;throwEofException)</code>
  190. <div class="block">Create an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> that emulates a specified
  191. size with option settings.</div>
  192. </td>
  193. </tr>
  194. </table>
  195. </li>
  196. </ul>
  197. <!-- ========== METHOD SUMMARY =========== -->
  198. <ul class="blockList">
  199. <li class="blockList"><a name="method.summary">
  200. <!-- -->
  201. </a>
  202. <h3>Method Summary</h3>
  203. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  204. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  205. <tr>
  206. <th class="colFirst" scope="col">Modifier and Type</th>
  207. <th class="colLast" scope="col">Method and Description</th>
  208. </tr>
  209. <tr id="i0" class="altColor">
  210. <td class="colFirst"><code>int</code></td>
  211. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#available--">available</a></span>()</code>
  212. <div class="block">Return the number of bytes that can be read.</div>
  213. </td>
  214. </tr>
  215. <tr id="i1" class="rowColor">
  216. <td class="colFirst"><code>void</code></td>
  217. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#close--">close</a></span>()</code>
  218. <div class="block">Close this input stream - resets the internal state to
  219. the initial values.</div>
  220. </td>
  221. </tr>
  222. <tr id="i2" class="altColor">
  223. <td class="colFirst"><code>long</code></td>
  224. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#getPosition--">getPosition</a></span>()</code>
  225. <div class="block">Return the current position.</div>
  226. </td>
  227. </tr>
  228. <tr id="i3" class="rowColor">
  229. <td class="colFirst"><code>long</code></td>
  230. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#getSize--">getSize</a></span>()</code>
  231. <div class="block">Return the size this <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> emulates.</div>
  232. </td>
  233. </tr>
  234. <tr id="i4" class="altColor">
  235. <td class="colFirst"><code>void</code></td>
  236. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#mark-int-">mark</a></span>(int&nbsp;readlimit)</code>
  237. <div class="block">Mark the current position.</div>
  238. </td>
  239. </tr>
  240. <tr id="i5" class="rowColor">
  241. <td class="colFirst"><code>boolean</code></td>
  242. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#markSupported--">markSupported</a></span>()</code>
  243. <div class="block">Indicates whether <i>mark</i> is supported.</div>
  244. </td>
  245. </tr>
  246. <tr id="i6" class="altColor">
  247. <td class="colFirst"><code>protected int</code></td>
  248. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#processByte--">processByte</a></span>()</code>
  249. <div class="block">Return a byte value for the <code>read()</code> method.</div>
  250. </td>
  251. </tr>
  252. <tr id="i7" class="rowColor">
  253. <td class="colFirst"><code>protected void</code></td>
  254. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#processBytes-byte:A-int-int-">processBytes</a></span>(byte[]&nbsp;bytes,
  255. int&nbsp;offset,
  256. int&nbsp;length)</code>
  257. <div class="block">Process the bytes for the <code>read(byte[], offset, length)</code>
  258. method.</div>
  259. </td>
  260. </tr>
  261. <tr id="i8" class="altColor">
  262. <td class="colFirst"><code>int</code></td>
  263. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#read--">read</a></span>()</code>
  264. <div class="block">Read a byte.</div>
  265. </td>
  266. </tr>
  267. <tr id="i9" class="rowColor">
  268. <td class="colFirst"><code>int</code></td>
  269. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#read-byte:A-">read</a></span>(byte[]&nbsp;bytes)</code>
  270. <div class="block">Read some bytes into the specified array.</div>
  271. </td>
  272. </tr>
  273. <tr id="i10" class="altColor">
  274. <td class="colFirst"><code>int</code></td>
  275. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#read-byte:A-int-int-">read</a></span>(byte[]&nbsp;bytes,
  276. int&nbsp;offset,
  277. int&nbsp;length)</code>
  278. <div class="block">Read the specified number bytes into an array.</div>
  279. </td>
  280. </tr>
  281. <tr id="i11" class="rowColor">
  282. <td class="colFirst"><code>void</code></td>
  283. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#reset--">reset</a></span>()</code>
  284. <div class="block">Reset the stream to the point when mark was last called.</div>
  285. </td>
  286. </tr>
  287. <tr id="i12" class="altColor">
  288. <td class="colFirst"><code>long</code></td>
  289. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#skip-long-">skip</a></span>(long&nbsp;numberOfBytes)</code>
  290. <div class="block">Skip a specified number of bytes.</div>
  291. </td>
  292. </tr>
  293. </table>
  294. <ul class="blockList">
  295. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  296. <!-- -->
  297. </a>
  298. <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>
  299. <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-int-" title="class or interface in java.lang">wait</a></code></li>
  300. </ul>
  301. </li>
  302. </ul>
  303. </li>
  304. </ul>
  305. </div>
  306. <div class="details">
  307. <ul class="blockList">
  308. <li class="blockList">
  309. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  310. <ul class="blockList">
  311. <li class="blockList"><a name="constructor.detail">
  312. <!-- -->
  313. </a>
  314. <h3>Constructor Detail</h3>
  315. <a name="NullInputStream-long-">
  316. <!-- -->
  317. </a>
  318. <ul class="blockList">
  319. <li class="blockList">
  320. <h4>NullInputStream</h4>
  321. <pre>public&nbsp;NullInputStream(long&nbsp;size)</pre>
  322. <div class="block">Create an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> that emulates a specified size
  323. which supports marking and does not throw EOFException.</div>
  324. <dl>
  325. <dt><span class="paramLabel">Parameters:</span></dt>
  326. <dd><code>size</code> - The size of the input stream to emulate.</dd>
  327. </dl>
  328. </li>
  329. </ul>
  330. <a name="NullInputStream-long-boolean-boolean-">
  331. <!-- -->
  332. </a>
  333. <ul class="blockListLast">
  334. <li class="blockList">
  335. <h4>NullInputStream</h4>
  336. <pre>public&nbsp;NullInputStream(long&nbsp;size,
  337. boolean&nbsp;markSupported,
  338. boolean&nbsp;throwEofException)</pre>
  339. <div class="block">Create an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> that emulates a specified
  340. size with option settings.</div>
  341. <dl>
  342. <dt><span class="paramLabel">Parameters:</span></dt>
  343. <dd><code>size</code> - The size of the input stream to emulate.</dd>
  344. <dd><code>markSupported</code> - Whether this instance will support
  345. the <code>mark()</code> functionality.</dd>
  346. <dd><code>throwEofException</code> - Whether this implementation
  347. will throw an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io"><code>EOFException</code></a> or return -1 when the
  348. end of file is reached.</dd>
  349. </dl>
  350. </li>
  351. </ul>
  352. </li>
  353. </ul>
  354. <!-- ============ METHOD DETAIL ========== -->
  355. <ul class="blockList">
  356. <li class="blockList"><a name="method.detail">
  357. <!-- -->
  358. </a>
  359. <h3>Method Detail</h3>
  360. <a name="getPosition--">
  361. <!-- -->
  362. </a>
  363. <ul class="blockList">
  364. <li class="blockList">
  365. <h4>getPosition</h4>
  366. <pre>public&nbsp;long&nbsp;getPosition()</pre>
  367. <div class="block">Return the current position.</div>
  368. <dl>
  369. <dt><span class="returnLabel">Returns:</span></dt>
  370. <dd>the current position.</dd>
  371. </dl>
  372. </li>
  373. </ul>
  374. <a name="getSize--">
  375. <!-- -->
  376. </a>
  377. <ul class="blockList">
  378. <li class="blockList">
  379. <h4>getSize</h4>
  380. <pre>public&nbsp;long&nbsp;getSize()</pre>
  381. <div class="block">Return the size this <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> emulates.</div>
  382. <dl>
  383. <dt><span class="returnLabel">Returns:</span></dt>
  384. <dd>The size of the input stream to emulate.</dd>
  385. </dl>
  386. </li>
  387. </ul>
  388. <a name="available--">
  389. <!-- -->
  390. </a>
  391. <ul class="blockList">
  392. <li class="blockList">
  393. <h4>available</h4>
  394. <pre>public&nbsp;int&nbsp;available()</pre>
  395. <div class="block">Return the number of bytes that can be read.</div>
  396. <dl>
  397. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  398. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#available--" title="class or interface in java.io">available</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  399. <dt><span class="returnLabel">Returns:</span></dt>
  400. <dd>The number of bytes that can be read.</dd>
  401. </dl>
  402. </li>
  403. </ul>
  404. <a name="close--">
  405. <!-- -->
  406. </a>
  407. <ul class="blockList">
  408. <li class="blockList">
  409. <h4>close</h4>
  410. <pre>public&nbsp;void&nbsp;close()
  411. 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>
  412. <div class="block">Close this input stream - resets the internal state to
  413. the initial values.</div>
  414. <dl>
  415. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  416. <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>
  417. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  418. <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>
  419. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  420. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  421. <dt><span class="throwsLabel">Throws:</span></dt>
  422. <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> - If an error occurs.</dd>
  423. </dl>
  424. </li>
  425. </ul>
  426. <a name="mark-int-">
  427. <!-- -->
  428. </a>
  429. <ul class="blockList">
  430. <li class="blockList">
  431. <h4>mark</h4>
  432. <pre>public&nbsp;void&nbsp;mark(int&nbsp;readlimit)</pre>
  433. <div class="block">Mark the current position.</div>
  434. <dl>
  435. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  436. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#mark-int-" title="class or interface in java.io">mark</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  437. <dt><span class="paramLabel">Parameters:</span></dt>
  438. <dd><code>readlimit</code> - The number of bytes before this marked position
  439. is invalid.</dd>
  440. <dt><span class="throwsLabel">Throws:</span></dt>
  441. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</a></code> - if mark is not supported.</dd>
  442. </dl>
  443. </li>
  444. </ul>
  445. <a name="markSupported--">
  446. <!-- -->
  447. </a>
  448. <ul class="blockList">
  449. <li class="blockList">
  450. <h4>markSupported</h4>
  451. <pre>public&nbsp;boolean&nbsp;markSupported()</pre>
  452. <div class="block">Indicates whether <i>mark</i> is supported.</div>
  453. <dl>
  454. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  455. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#markSupported--" title="class or interface in java.io">markSupported</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  456. <dt><span class="returnLabel">Returns:</span></dt>
  457. <dd>Whether <i>mark</i> is supported or not.</dd>
  458. </dl>
  459. </li>
  460. </ul>
  461. <a name="read--">
  462. <!-- -->
  463. </a>
  464. <ul class="blockList">
  465. <li class="blockList">
  466. <h4>read</h4>
  467. <pre>public&nbsp;int&nbsp;read()
  468. 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>
  469. <div class="block">Read a byte.</div>
  470. <dl>
  471. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  472. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#read--" title="class or interface in java.io">read</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  473. <dt><span class="returnLabel">Returns:</span></dt>
  474. <dd>Either The byte value returned by <code>processByte()</code>
  475. or <code>-1</code> if the end of file has been reached and
  476. <code>throwEofException</code> is set to <code>false</code>.</dd>
  477. <dt><span class="throwsLabel">Throws:</span></dt>
  478. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the end of file is reached and
  479. <code>throwEofException</code> is set to <code>true</code>.</dd>
  480. <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> - if trying to read past the end of file.</dd>
  481. </dl>
  482. </li>
  483. </ul>
  484. <a name="read-byte:A-">
  485. <!-- -->
  486. </a>
  487. <ul class="blockList">
  488. <li class="blockList">
  489. <h4>read</h4>
  490. <pre>public&nbsp;int&nbsp;read(byte[]&nbsp;bytes)
  491. 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>
  492. <div class="block">Read some bytes into the specified array.</div>
  493. <dl>
  494. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  495. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#read-byte:A-" title="class or interface in java.io">read</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  496. <dt><span class="paramLabel">Parameters:</span></dt>
  497. <dd><code>bytes</code> - The byte array to read into</dd>
  498. <dt><span class="returnLabel">Returns:</span></dt>
  499. <dd>The number of bytes read or <code>-1</code>
  500. if the end of file has been reached and
  501. <code>throwEofException</code> is set to <code>false</code>.</dd>
  502. <dt><span class="throwsLabel">Throws:</span></dt>
  503. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the end of file is reached and
  504. <code>throwEofException</code> is set to <code>true</code>.</dd>
  505. <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> - if trying to read past the end of file.</dd>
  506. </dl>
  507. </li>
  508. </ul>
  509. <a name="read-byte:A-int-int-">
  510. <!-- -->
  511. </a>
  512. <ul class="blockList">
  513. <li class="blockList">
  514. <h4>read</h4>
  515. <pre>public&nbsp;int&nbsp;read(byte[]&nbsp;bytes,
  516. int&nbsp;offset,
  517. int&nbsp;length)
  518. 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>
  519. <div class="block">Read the specified number bytes into an array.</div>
  520. <dl>
  521. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  522. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#read-byte:A-int-int-" title="class or interface in java.io">read</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  523. <dt><span class="paramLabel">Parameters:</span></dt>
  524. <dd><code>bytes</code> - The byte array to read into.</dd>
  525. <dd><code>offset</code> - The offset to start reading bytes into.</dd>
  526. <dd><code>length</code> - The number of bytes to read.</dd>
  527. <dt><span class="returnLabel">Returns:</span></dt>
  528. <dd>The number of bytes read or <code>-1</code>
  529. if the end of file has been reached and
  530. <code>throwEofException</code> is set to <code>false</code>.</dd>
  531. <dt><span class="throwsLabel">Throws:</span></dt>
  532. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the end of file is reached and
  533. <code>throwEofException</code> is set to <code>true</code>.</dd>
  534. <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> - if trying to read past the end of file.</dd>
  535. </dl>
  536. </li>
  537. </ul>
  538. <a name="reset--">
  539. <!-- -->
  540. </a>
  541. <ul class="blockList">
  542. <li class="blockList">
  543. <h4>reset</h4>
  544. <pre>public&nbsp;void&nbsp;reset()
  545. 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>
  546. <div class="block">Reset the stream to the point when mark was last called.</div>
  547. <dl>
  548. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  549. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#reset--" title="class or interface in java.io">reset</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  550. <dt><span class="throwsLabel">Throws:</span></dt>
  551. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</a></code> - if mark is not supported.</dd>
  552. <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> - If no position has been marked
  553. or the read limit has been exceed since the last position was
  554. marked.</dd>
  555. </dl>
  556. </li>
  557. </ul>
  558. <a name="skip-long-">
  559. <!-- -->
  560. </a>
  561. <ul class="blockList">
  562. <li class="blockList">
  563. <h4>skip</h4>
  564. <pre>public&nbsp;long&nbsp;skip(long&nbsp;numberOfBytes)
  565. 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>
  566. <div class="block">Skip a specified number of bytes.</div>
  567. <dl>
  568. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  569. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true#skip-long-" title="class or interface in java.io">skip</a></code>&nbsp;in class&nbsp;<code><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></code></dd>
  570. <dt><span class="paramLabel">Parameters:</span></dt>
  571. <dd><code>numberOfBytes</code> - The number of bytes to skip.</dd>
  572. <dt><span class="returnLabel">Returns:</span></dt>
  573. <dd>The number of bytes skipped or <code>-1</code>
  574. if the end of file has been reached and
  575. <code>throwEofException</code> is set to <code>false</code>.</dd>
  576. <dt><span class="throwsLabel">Throws:</span></dt>
  577. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the end of file is reached and
  578. <code>throwEofException</code> is set to <code>true</code>.</dd>
  579. <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> - if trying to read past the end of file.</dd>
  580. </dl>
  581. </li>
  582. </ul>
  583. <a name="processByte--">
  584. <!-- -->
  585. </a>
  586. <ul class="blockList">
  587. <li class="blockList">
  588. <h4>processByte</h4>
  589. <pre>protected&nbsp;int&nbsp;processByte()</pre>
  590. <div class="block">Return a byte value for the <code>read()</code> method.
  591. <p>
  592. This implementation returns zero.</div>
  593. <dl>
  594. <dt><span class="returnLabel">Returns:</span></dt>
  595. <dd>This implementation always returns zero.</dd>
  596. </dl>
  597. </li>
  598. </ul>
  599. <a name="processBytes-byte:A-int-int-">
  600. <!-- -->
  601. </a>
  602. <ul class="blockListLast">
  603. <li class="blockList">
  604. <h4>processBytes</h4>
  605. <pre>protected&nbsp;void&nbsp;processBytes(byte[]&nbsp;bytes,
  606. int&nbsp;offset,
  607. int&nbsp;length)</pre>
  608. <div class="block">Process the bytes for the <code>read(byte[], offset, length)</code>
  609. method.
  610. <p>
  611. This implementation leaves the byte array unchanged.</div>
  612. <dl>
  613. <dt><span class="paramLabel">Parameters:</span></dt>
  614. <dd><code>bytes</code> - The byte array</dd>
  615. <dd><code>offset</code> - The offset to start at.</dd>
  616. <dd><code>length</code> - The number of bytes.</dd>
  617. </dl>
  618. </li>
  619. </ul>
  620. </li>
  621. </ul>
  622. </li>
  623. </ul>
  624. </div>
  625. </div>
  626. <!-- ========= END OF CLASS DATA ========= -->
  627. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  628. <div class="bottomNav"><a name="navbar.bottom">
  629. <!-- -->
  630. </a>
  631. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  632. <a name="navbar.bottom.firstrow">
  633. <!-- -->
  634. </a>
  635. <ul class="navList" title="Navigation">
  636. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  637. <li><a href="package-summary.html">Package</a></li>
  638. <li class="navBarCell1Rev">Class</li>
  639. <li><a href="class-use/NullInputStream.html">Use</a></li>
  640. <li><a href="package-tree.html">Tree</a></li>
  641. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  642. <li><a href="../../../../../index-all.html">Index</a></li>
  643. <li><a href="../../../../../help-doc.html">Help</a></li>
  644. </ul>
  645. </div>
  646. <div class="subNav">
  647. <ul class="navList">
  648. <li><a href="../../../../../org/apache/commons/io/input/MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  649. <li><a href="../../../../../org/apache/commons/io/input/NullReader.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  650. </ul>
  651. <ul class="navList">
  652. <li><a href="../../../../../index.html?org/apache/commons/io/input/NullInputStream.html" target="_top">Frames</a></li>
  653. <li><a href="NullInputStream.html" target="_top">No&nbsp;Frames</a></li>
  654. </ul>
  655. <ul class="navList" id="allclasses_navbar_bottom">
  656. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  657. </ul>
  658. <div>
  659. <script type="text/javascript"><!--
  660. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  661. if(window==top) {
  662. allClassesLink.style.display = "block";
  663. }
  664. else {
  665. allClassesLink.style.display = "none";
  666. }
  667. //-->
  668. </script>
  669. </div>
  670. <div>
  671. <ul class="subNavList">
  672. <li>Summary:&nbsp;</li>
  673. <li>Nested&nbsp;|&nbsp;</li>
  674. <li>Field&nbsp;|&nbsp;</li>
  675. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  676. <li><a href="#method.summary">Method</a></li>
  677. </ul>
  678. <ul class="subNavList">
  679. <li>Detail:&nbsp;</li>
  680. <li>Field&nbsp;|&nbsp;</li>
  681. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  682. <li><a href="#method.detail">Method</a></li>
  683. </ul>
  684. </div>
  685. <a name="skip.navbar.bottom">
  686. <!-- -->
  687. </a></div>
  688. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  689. <p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  690. </body>
  691. </html>