The class is the superclass of all classes that filter output streams. Following are the important points about FilterOutputStream:

  • The class itself simply overrides all methods of OutputStream with versions that pass all requests to the contained output stream.

  • The Subclasses of this class may further override some of these methods and may also provide additional methods and fields.

Class declaration

Following is the declaration for class:

public class FilterOutputStream
   extends OutputStream


Following are the fields for class:

  • protected OutputStream out -- This is the output stream to be filtered.

Class constructors

S.N. Constructor & Description

FilterOutputStream(OutputStream out)

This creates an output stream filter built on top of the specified underlying output stream.

Class methods

S.N. Method & Description

void close()

This method closes this output stream and releases any system resources associated with the stream.


void flush()

This method flushes this output stream and forces any buffered output bytes to be written out to the stream.


void write(byte[] b)

This method writes b.length bytes to this output stream.


void write(byte[] b, int off, int len)

This method writes len bytes from the specified byte array starting at offset off to this output stream.


void write(int b)

This method writes the specified byte to this output stream.

Methods inherited

This class inherits methods from the following classes: