|
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.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.
Constructor Summary | |
---|---|
NoCloseOutputStream(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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoCloseOutputStream(OutputStream out)
out
- The output stream that is being protected.Method Detail |
---|
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
reallyClose()
public void reallyClose() throws IOException
reallyClose
in interface NoCloseStream
IOException
- 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 © 2001-2012 by Stephen Ostermiller