com.calitha.io
Class NoCloseInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.calitha.io.NoCloseInputStream
All Implemented Interfaces:
Closeable

public class NoCloseInputStream
extends FilterInputStream

A NoCloseInputStream is used in the case where calls to close an input stream must be ignored.

This class is necessary for reading XML files from a zip input stream, because the parser kept closing the stream.

Author:
Robert van Loenhout

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
NoCloseInputStream(InputStream input)
          Creates a new FilterInputStream where most calls are forwarded to the input stream passed to it.
 
Method Summary
 void close()
          This method ignores when close is called.
 
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCloseInputStream

public NoCloseInputStream(InputStream input)
Creates a new FilterInputStream where most calls are forwarded to the input stream passed to it.

Parameters:
input - input stream
Method Detail

close

public void close()
This method ignores when close is called.

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream