<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>NullInputStream (Apache Commons IO 2.6 API)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="NullInputStream (Apache Commons IO 2.6 API)"; } } catch(err) { } //--> 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}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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="class-use/NullInputStream.html">Use</a></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/commons/io/input/MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../../org/apache/commons/io/input/NullReader.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/commons/io/input/NullInputStream.html" target="_top">Frames</a></li> <li><a href="NullInputStream.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: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </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.commons.io.input</div> <h2 title="Class NullInputStream" class="title">Class NullInputStream</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <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> <li> <ul class="inheritance"> <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> <li> <ul class="inheritance"> <li>org.apache.commons.io.input.NullInputStream</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <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> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">NullInputStream</span> 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> <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 a stream of a specified size. <p> This implementation provides a light weight 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> where the contents don't matter. <p> One use case would be for testing the handling of 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 scenario without the overhead of actually processing large numbers of bytes - significantly speeding up test execution times. <p> This implementation returns zero from the method that reads a byte and leaves the array unchanged in the read methods that are passed a byte array. If alternative data is required the <code>processByte()</code> and <code>processBytes()</code> methods can be implemented to generate data, for example: <pre> public class TestInputStream extends NullInputStream { public TestInputStream(int size) { super(size); } protected int processByte() { return ... // return required value here } protected void processBytes(byte[] bytes, int offset, int length) { for (int i = offset; i < length; i++) { bytes[i] = ... // set array value here } } } </pre></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.3</dd> <dt><span class="simpleTagLabel">Version:</span></dt> <dd>$Id$</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#NullInputStream-long-">NullInputStream</a></span>(long size)</code> <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 which supports marking and does not throw EOFException.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#NullInputStream-long-boolean-boolean-">NullInputStream</a></span>(long size, boolean markSupported, boolean throwEofException)</code> <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 with option settings.</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#available--">available</a></span>()</code> <div class="block">Return the number of bytes that can be read.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#close--">close</a></span>()</code> <div class="block">Close this input stream - resets the internal state to the initial values.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#getPosition--">getPosition</a></span>()</code> <div class="block">Return the current position.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#getSize--">getSize</a></span>()</code> <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> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#mark-int-">mark</a></span>(int readlimit)</code> <div class="block">Mark the current position.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#markSupported--">markSupported</a></span>()</code> <div class="block">Indicates whether <i>mark</i> is supported.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>protected int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#processByte--">processByte</a></span>()</code> <div class="block">Return a byte value for the <code>read()</code> method.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <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[] bytes, int offset, int length)</code> <div class="block">Process the bytes for the <code>read(byte[], offset, length)</code> method.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#read--">read</a></span>()</code> <div class="block">Read a byte.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#read-byte:A-">read</a></span>(byte[] bytes)</code> <div class="block">Read some bytes into the specified array.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>int</code></td> <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[] bytes, int offset, int length)</code> <div class="block">Read the specified number bytes into an array.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#reset--">reset</a></span>()</code> <div class="block">Reset the stream to the point when mark was last called.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/NullInputStream.html#skip-long-">skip</a></span>(long numberOfBytes)</code> <div class="block">Skip a specified number of bytes.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class 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> <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> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="NullInputStream-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NullInputStream</h4> <pre>public NullInputStream(long size)</pre> <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 which supports marking and does not throw EOFException.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>size</code> - The size of the input stream to emulate.</dd> </dl> </li> </ul> <a name="NullInputStream-long-boolean-boolean-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>NullInputStream</h4> <pre>public NullInputStream(long size, boolean markSupported, boolean throwEofException)</pre> <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 with option settings.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>size</code> - The size of the input stream to emulate.</dd> <dd><code>markSupported</code> - Whether this instance will support the <code>mark()</code> functionality.</dd> <dd><code>throwEofException</code> - Whether this implementation 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 end of file is reached.</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="getPosition--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPosition</h4> <pre>public long getPosition()</pre> <div class="block">Return the current position.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the current position.</dd> </dl> </li> </ul> <a name="getSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSize</h4> <pre>public long getSize()</pre> <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> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The size of the input stream to emulate.</dd> </dl> </li> </ul> <a name="available--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>available</h4> <pre>public int available()</pre> <div class="block">Return the number of bytes that can be read.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="returnLabel">Returns:</span></dt> <dd>The number of bytes that can be read.</dd> </dl> </li> </ul> <a name="close--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>close</h4> <pre>public void close() 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> <div class="block">Close this input stream - resets the internal state to the initial values.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <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> in interface <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> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <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> in interface <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> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="throwsLabel">Throws:</span></dt> <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> </dl> </li> </ul> <a name="mark-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>mark</h4> <pre>public void mark(int readlimit)</pre> <div class="block">Mark the current position.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>readlimit</code> - The number of bytes before this marked position is invalid.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <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> </dl> </li> </ul> <a name="markSupported--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>markSupported</h4> <pre>public boolean markSupported()</pre> <div class="block">Indicates whether <i>mark</i> is supported.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="returnLabel">Returns:</span></dt> <dd>Whether <i>mark</i> is supported or not.</dd> </dl> </li> </ul> <a name="read--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>read</h4> <pre>public int read() 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> <div class="block">Read a byte.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <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> in class <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> <dt><span class="returnLabel">Returns:</span></dt> <dd>Either The byte value returned by <code>processByte()</code> or <code>-1</code> if the end of file has been reached and <code>throwEofException</code> is set to <code>false</code>.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <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 <code>throwEofException</code> is set to <code>true</code>.</dd> <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> </dl> </li> </ul> <a name="read-byte:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>read</h4> <pre>public int read(byte[] bytes) 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> <div class="block">Read some bytes into the specified array.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bytes</code> - The byte array to read into</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The number of bytes read or <code>-1</code> if the end of file has been reached and <code>throwEofException</code> is set to <code>false</code>.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <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 <code>throwEofException</code> is set to <code>true</code>.</dd> <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> </dl> </li> </ul> <a name="read-byte:A-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>read</h4> <pre>public int read(byte[] bytes, int offset, int length) 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> <div class="block">Read the specified number bytes into an array.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bytes</code> - The byte array to read into.</dd> <dd><code>offset</code> - The offset to start reading bytes into.</dd> <dd><code>length</code> - The number of bytes to read.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The number of bytes read or <code>-1</code> if the end of file has been reached and <code>throwEofException</code> is set to <code>false</code>.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <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 <code>throwEofException</code> is set to <code>true</code>.</dd> <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> </dl> </li> </ul> <a name="reset--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>reset</h4> <pre>public void reset() 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> <div class="block">Reset the stream to the point when mark was last called.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="throwsLabel">Throws:</span></dt> <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> <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 or the read limit has been exceed since the last position was marked.</dd> </dl> </li> </ul> <a name="skip-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>skip</h4> <pre>public long skip(long numberOfBytes) 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> <div class="block">Skip a specified number of bytes.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <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> in class <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> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>numberOfBytes</code> - The number of bytes to skip.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The number of bytes skipped or <code>-1</code> if the end of file has been reached and <code>throwEofException</code> is set to <code>false</code>.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <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 <code>throwEofException</code> is set to <code>true</code>.</dd> <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> </dl> </li> </ul> <a name="processByte--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>processByte</h4> <pre>protected int processByte()</pre> <div class="block">Return a byte value for the <code>read()</code> method. <p> This implementation returns zero.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>This implementation always returns zero.</dd> </dl> </li> </ul> <a name="processBytes-byte:A-int-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>processBytes</h4> <pre>protected void processBytes(byte[] bytes, int offset, int length)</pre> <div class="block">Process the bytes for the <code>read(byte[], offset, length)</code> method. <p> This implementation leaves the byte array unchanged.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>bytes</code> - The byte array</dd> <dd><code>offset</code> - The offset to start at.</dd> <dd><code>length</code> - The number of bytes.</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> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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="class-use/NullInputStream.html">Use</a></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/commons/io/input/MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../../../org/apache/commons/io/input/NullReader.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/commons/io/input/NullInputStream.html" target="_top">Frames</a></li> <li><a href="NullInputStream.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: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright © 2002–2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>