java.io
Class FilterOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
Direct Known Subclasses:
BufferedOutputStream, DataOutputStream, PrintStream

public class FilterOutputStream
extends OutputStream

A FilterOutputStream contains another output stream, which it uses as its basic data drain, possibly transforming the data before it is written to the stream.


Constructor Summary
FilterOutputStream(OutputStream os)
          Creates a new instance of FilterOutputStream.
 
Method Summary
 void close()
          Closes the underlying output stream and releases all system resources associated with it.
 void flush()
          Flushes the underlying output stream.
 void write(byte[] b)
          Writes b.length bytes from b to the underlying output stream.
 void write(byte[] b, int off, int len)
          Writes len bytes from b to the underlying output stream starting at offset off.
 void write(int i)
          Writes a single byte to the underlying output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, toString
 

Constructor Detail

FilterOutputStream

public FilterOutputStream(OutputStream os)
Creates a new instance of FilterOutputStream. The passed output stream is stored and used for output.

Parameters:
os - Output stream to write data to.
Method Detail

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Writes len bytes from b to the underlying output stream starting at offset off.

Overrides:
write in class OutputStream
Parameters:
b - Array of bytes containing the data to be written.
off - Offset into b where the data begins.
len - Number of bytes to be written.
Throws:
IOException - if an I/O error occures.

close

public void close()
           throws IOException
Closes the underlying output stream and releases all system resources associated with it.

Overrides:
close in class OutputStream
IOException

flush

public void flush()
           throws IOException
Flushes the underlying output stream.

Overrides:
flush in class OutputStream
IOException

write

public void write(byte[] b)
           throws IOException
Writes b.length bytes from b to the underlying output stream.

Overrides:
write in class OutputStream
Parameters:
b - Array of bytes containing the data to be written.
Throws:
IOException - if an I/O error occures.

write

public void write(int i)
           throws IOException
Writes a single byte to the underlying output stream.

Specified by:
write in class OutputStream
Parameters:
i - The byte of data to write.
Throws:
IOException - if an I/O error occures.