org.freehep.util.io
Class NoCloseWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.BufferedWriter
          extended by org.freehep.util.io.NoCloseWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class NoCloseWriter
extends BufferedWriter

The NoCloseWriter ignores the close so that one can keep writing to the underlying stream.

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

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
NoCloseWriter(Writer writer)
          Creates a No Close Writer
NoCloseWriter(Writer writer, int size)
          Creates a No Close Writer
 
Method Summary
 void close()
           
 void realClose()
          Closes the writer (close is ignored).
 
Methods inherited from class java.io.BufferedWriter
flush, newLine, write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoCloseWriter

public NoCloseWriter(Writer writer)
Creates a No Close Writer

Parameters:
writer - writer to write to

NoCloseWriter

public NoCloseWriter(Writer writer,
                     int size)
Creates a No Close Writer

Parameters:
writer - writer to write to
size - buffer size
Method Detail

close

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

realClose

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

Throws:
IOException - if the close fails


Copyright © 2000-2007 FreeHEP. All Rights Reserved.