FIM.Util
Class CopyFilterOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--FIM.Util.CopyFilterOutputStream
- public class CopyFilterOutputStream
- extends FilterOutputStream
A stream which copies all data sent through it to another stream. The content itself is not touched in any way.
- Version:
- 1.0, 12.9.2001
- Author:
- Michael Sonntag
Method Summary |
void |
close()
Closes the destination and the copy stream. |
void |
flush()
Flushes the destination and the copy stream. |
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to the output and the copy stream. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off to the output and the copy stream. |
void |
write(int b)
Writes the byte to the output and the copy stream. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CopyFilterOutputStream
public CopyFilterOutputStream(OutputStream out,
OutputStream copy)
- Create a new stream to copy the content written through to another stream.
- Parameters:
out
- the underlying OutputStream
close
public void close()
throws IOException
- Closes the destination and the copy stream.
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException
- if an exception occurred in the underlying stream (either the destination or the copy)
flush
public void flush()
throws IOException
- Flushes the destination and the copy stream.
- Overrides:
flush
in class FilterOutputStream
- Throws:
IOException
- if an exception occurred in the underlying stream (either the destination or the copy)
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Writes len bytes from the specified byte array starting at offset off to the output and the copy stream.
- Overrides:
write
in class FilterOutputStream
- Parameters:
b
- the dataoff
- the start offset in the datalen
- the number of bytes to write- Throws:
IOException
- if an exception occurred in the underlying stream (either the destination or the copy)
write
public void write(int b)
throws IOException
- Writes the byte to the output and the copy stream.
- Overrides:
write
in class FilterOutputStream
- Parameters:
b
- the byte to be written- Throws:
IOException
- if an exception occurred in the underlying stream (either the destination or the copy)
write
public void write(byte[] b)
throws IOException
- Writes
b.length
bytes from the specified byte array to the output and the copy stream.
- Overrides:
write
in class FilterOutputStream
- Parameters:
b
- the data- Throws:
IOException
- if an exception occurred in the underlying stream (either the destination or the copy)
Submit a bug
Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.