|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
com.Ostermiller.util.NoCloseOutputStream
public class NoCloseOutputStream
An output stream 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 output stream 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 java.io.OutputStream |
out
The output stream that is being protected. |
| Constructor Summary | |
|---|---|
NoCloseOutputStream(java.io.OutputStream out)
Protect a new output stream. |
|
| 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(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.OutputStream out
| Constructor Detail |
|---|
public NoCloseOutputStream(java.io.OutputStream out)
out - The output stream that is being protected.| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOExceptionreallyClose()
public void reallyClose()
throws java.io.IOException
reallyClose in interface NoCloseStreamjava.io.IOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||