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.
Modifier and Type | Field and Description |
---|---|
private volatile boolean | closed
Whether the stream is closed; implicitly initialized to false. |
private final Object | closeLock
Object used to prevent a race on the 'closed' instance variable. |
protected OutputStream | out
The underlying output stream to be filtered. |
Access | Constructor and Description |
---|---|
public | FilterOutputStream(OutputStream
the underlying output stream to be assigned to
the field out)this.out for later use, or
null if this instance is to be
created without an underlying stream.Creates an output stream filter built on top of the specified underlying output stream. |
Modifier and Type | Method and Description |
---|---|
public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with the stream. |
public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out to the stream. |
public void | write(int
the b)byte .Implements abstract java. Writes the specified |
public void | write(byte[]
the data to be written. b)Overrides java. Writes |
public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
closed | back to summary |
---|---|
private volatile boolean closed Whether the stream is closed; implicitly initialized to false. |
closeLock | back to summary |
---|---|
private final Object closeLock Object used to prevent a race on the 'closed' instance variable. |
out | back to summary |
---|---|
protected OutputStream out The underlying output stream to be filtered. |
FilterOutputStream | back to summary |
---|---|
public FilterOutputStream(OutputStream out) Creates an output stream filter built on top of the specified underlying output stream.
|
close | back to summary |
---|---|
public void close() throws IOException Overrides java. Implements java. Closes this output stream and releases any system resources associated with the stream. Implementation Specification When not already closed, the
|
flush | back to summary |
---|---|
public void flush() throws IOException Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out to the stream. Implementation Specification The
|
write | back to summary |
---|---|
public void write(int b) throws IOException Implements abstract java. Writes the specified
The
Implements the abstract
|
write | back to summary |
---|---|
public void write(byte[] b) throws IOException Overrides java. Writes Implementation Specification The Implementation Note Note that this method does not call the one-argument
|
write | back to summary |
---|---|
public void write(byte[] b, int off, int len) throws IOException Overrides java. Writes Implementation Specification The Implementation Note Note that this method does not call the
|