org.freehep.util.io
Class NoCloseReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by org.freehep.util.io.NoCloseReader
All Implemented Interfaces:
Closeable, Readable

public class NoCloseReader
extends BufferedReader

The NoCloseReader ignores the close so that one can keep reading from the underlying stream.

Version:
$Id: NoCloseReader.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
NoCloseReader(Reader reader)
          Creates a No Close Reader.
NoCloseReader(Reader reader, int size)
          Creates a No Close Reader.
 
Method Summary
 void close()
           
 void realClose()
          Closes the reader (close is ignored).
 
Methods inherited from class java.io.BufferedReader
mark, markSupported, read, read, readLine, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCloseReader

public NoCloseReader(Reader reader)
Creates a No Close Reader.

Parameters:
reader - reader to read from

NoCloseReader

public NoCloseReader(Reader reader,
                     int size)
Creates a No Close Reader.

Parameters:
reader - reader to read from
size - buffer size
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class BufferedReader
Throws:
IOException

realClose

public void realClose()
               throws IOException
Closes the reader (close is ignored).

Throws:
IOException - if the close fails


Copyright © 2000-2007 FreeHEP. All Rights Reserved.