sam.io
Class CloseAvoiderOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--sam.io.CloseAvoiderOutputStream
- public class CloseAvoiderOutputStream
- extends java.io.OutputStream
OutputStream
that interrupts close()
calls.
Usefull to avoid closing an archive while writing a single entry.
Method Summary |
void |
close()
Avois closing the underlying stream, but flushes it to mimic a close() call |
void |
flush()
|
void |
reallyDoClose()
Really closes the stream |
void |
write(byte[] data,
int begin,
int end)
|
void |
write(int b)
|
Methods inherited from class java.io.OutputStream |
write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CloseAvoiderOutputStream
public CloseAvoiderOutputStream(java.io.OutputStream delegee)
flush
public void flush()
throws java.io.IOException
- Overrides:
flush
in class java.io.OutputStream
java.io.IOException
write
public void write(int b)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
java.io.IOException
write
public void write(byte[] data,
int begin,
int end)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
java.io.IOException
close
public void close()
throws java.io.IOException
- Avois closing the underlying stream, but flushes it to mimic a
close()
call
- Overrides:
close
in class java.io.OutputStream
java.io.IOException
reallyDoClose
public void reallyDoClose()
throws java.io.IOException
- Really closes the stream
java.io.IOException