public class FilterOutputStream extends OutputStream
OutputStreamand performs some transformation on the output data while it is being written. Transformations can be anything from a simple byte-wise filtering output data to an on-the-fly compression or decompression of the underlying stream. Output streams that wrap another output stream and provide some additional functionality on top of it usually inherit from this class.
|Modifier and Type||Field and Description|
The target output stream for this filter stream.
|Constructor and Description|
Constructs a new
|Modifier and Type||Method and Description|
Closes this stream.
Ensures that all pending data is sent out to the target stream.
Writes one byte to the target stream.
protected OutputStream out
public FilterOutputStream(OutputStream out)
outas its target stream.
out- the target stream that this stream writes to.
public void close() throws IOException
public void flush() throws IOException
public void write(byte buffer, int offset, int length) throws IOException
countbytes from the byte array
offsetto the target stream.
buffer- the buffer to write.
offset- the index of the first byte in
length- the number of bytes in
offset < 0or
count < 0, or if
offset + countis bigger than the length of
IOException- if an I/O error occurs while writing to this stream.
public void write(int oneByte) throws IOException