org.apache.tika.io
Class ClosedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.tika.io.ClosedInputStream
All Implemented Interfaces:
Closeable

public class ClosedInputStream
extends InputStream

Closed input stream. This stream returns -1 to all attempts to read something from the stream.

Typically uses of this class include testing for corner cases in methods that accept input streams and acting as a sentinel value instead of a null input stream.

Since:
Apache Tika 0.4, copied from Commons IO 1.4

Constructor Summary
ClosedInputStream()
           
 
Method Summary
 int read()
          Returns -1 to indicate that the stream is closed.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosedInputStream

public ClosedInputStream()
Method Detail

read

public int read()
Returns -1 to indicate that the stream is closed.

Specified by:
read in class InputStream
Returns:
always -1


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.