Class: java.io.FilterOutputStream
- public class FilterOutputStream
- extends OutputStream
The class FilterOutputStream itself simply overrides
all methods of OutputStream with versions that pass
all requests to the underlying output stream. Subclasses of
FilterOutputStream may further override some of these
methods as well as provide additional methods and fields.
Inheritance
Superclass tree:- java.lang.Object
- java.io.OutputStream
- java.io.FilterOutputStream
Methods
-
FilterOutputStreamtop
public FilterOutputStream(OutputStream out)Creates an output stream filter built on top of the specified underlying output stream. -
closetop
public void close() throws IOExceptionCloses this output stream and releases any system resources associated with the stream.The
closemethod ofFilterOutputStreamcalls itsflushmethod, and then calls theclosemethod of its underlying output stream.- Override hierarchy:
- close from OutputStream
-
flushtop
public void flush() throws IOExceptionFlushes this output stream and forces any buffered output bytes to be written out to the stream.The
flushmethod ofFilterOutputStreamcalls theflushmethod of its underlying output stream.- Override hierarchy:
- flush from OutputStream
-
writetop
public void write(int b) throws IOExceptionWrites the specifiedbyteto this output stream.The
writemethod ofFilterOutputStreamcalls thewritemethod of its underlying output stream, that is, it performs out.write(b).Implements the abstract write method of OutputStream.
- Override hierarchy:
- write from OutputStream
-
writetop
public void write(byte[] b) throws IOExceptionWritesb.lengthbytes to this output stream.The
writemethod ofFilterOutputStreamcalls itswritemethod of three arguments with the argumentsb,0, andb.length.Note that this method does not call the one-argument
writemethod of its underlying stream with the single argumentb.- Override hierarchy:
- write from OutputStream
-
writetop
public void write(byte[] b, int off, int len) throws IOExceptionWriteslenbytes from the specifiedbytearray starting at offsetoffto this output stream.The
writemethod ofFilterOutputStreamcalls thewritemethod of one argument on eachbyteto output.Note that this method does not call the
writemethod of its underlying input stream with the same arguments. Subclasses ofFilterOutputStreamshould provide a more efficient implementation of this method.- Override hierarchy:
- write from OutputStream
Fields
-
out
protected OutputStream outThe underlying output stream to be filtered.
