|
com.Ostermiller.util Java Utilities |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.Writer
com.Ostermiller.util.NoCloseWriter
public class NoCloseWriter
A writer with a close method with no effect. More information about this class is available from ostermiller.org.
This class is designed to wrap a normal writer so that it can be passed to methods that write to it and may erroneously close it. This class is a workaround when the method cannot be modified because it is in a library.
| Field Summary | |
|---|---|
protected Writer |
out
The writer that is being protected. |
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
NoCloseWriter(Writer out)
Protect a new writer. |
|
| Method Summary | |
|---|---|
void |
close()
Has no effect. |
void |
flush()
|
void |
reallyClose()
Actually closes this stream and releases any system resources associated with the stream, as opposed to the close() method, which does nothing. |
void |
write(char[] cbuf)
|
void |
write(char[] cbuf,
int off,
int len)
|
void |
write(int c)
|
void |
write(String str)
|
void |
write(String str,
int off,
int len)
|
| Methods inherited from class java.io.Writer |
|---|
append, append, append |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Writer out
| Constructor Detail |
|---|
public NoCloseWriter(Writer out)
out - The writer that is being protected.| Method Detail |
|---|
public void write(int c)
throws IOException
write in class WriterIOException
public void write(char[] cbuf)
throws IOException
write in class WriterIOException
public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOException
public void write(String str)
throws IOException
write in class WriterIOException
public void write(String str,
int off,
int len)
throws IOException
write in class WriterIOException
public void flush()
throws IOException
flush in interface Flushableflush in class WriterIOException
public void close()
throws IOException
close in interface Closeableclose in class WriterIOExceptionreallyClose()
public void reallyClose()
throws IOException
reallyClose in interface NoCloseStreamIOException - if an I/O error occurs.
|
com.Ostermiller.util Java Utilities |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Copyright (c) 2001-2007 by Stephen Ostermiller