java.io.FilterOutputStream
FilteredOutputStream is a class which takes an output stream and
filters the output in some way. The filtered view may be a
buffered output or one which compresses data before actually writing the
bytes. FilterOutputStreams are meant for byte streams.
Known Direct Subclasses
BufferedOutputStream |
BufferedOutputStream is a class which takes an output stream and
buffers the writes to that stream. |
CheckedOutputStream |
The CheckedOutputStream class is used to maintain a running Checksum of all
data written to a stream. |
CipherOutputStream |
|
DataOutputStream |
DataOutputStream is a filter class which can write typed data to a Stream. |
DeflaterOutputStream |
The DeflaterOutputStream class implements a stream filter for the writing of
compressed data to a stream. |
DigestOutputStream |
|
PrintStream |
PrintStream is a class which takes an OutputStream and provides convenience
methods for printing common data types in a human readable format on the
stream. |
Known Indirect Subclasses
GZIPOutputStream |
The GZIPOutputStream class is used to write data to a stream in the GZIP
storage format. |
JarOutputStream |
The JarOutputStream is used to output data in JarFile format. |
ZipOutputStream |
ZipOutputStream is used to write ZipEntries to the underlying stream. |
Summary
Fields
Public Constructors
Public Methods
|
|
|
|
|
void |
close() |
|
|
|
|
|
void |
flush() |
|
|
|
|
|
void |
write(byte[] buffer) |
abstract |
|
|
|
|
void |
write(int oneByte) |
|
|
|
|
|
void |
write(byte[] buffer, int offset, int count) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Fields
The target OutputStream for this filter.
Public Constructors
public
FilterOutputStream(OutputStream out)
Constructs a new FilterOutputStream on the OutputStream
out
.
All writes are now filtered through this stream.
Parameters
out
| the target OutputStream to filter writes on.
|
Public Methods
public
void
close()
Close this FilterOutputStream. This implementation closes the target
stream.
Throws
IOException
| If an error occurs attempting to close this stream.
|
public
void
flush()
Flush this FilterOutputStream to ensure all pending data is sent out to
the target OutputStream. This implementation flushes the target
OutputStream.
Throws
IOException
| If an error occurs attempting to flush this
FilterOutputStream.
|
public
void
write(byte[] buffer)
Writes the entire contents of the byte array
buffer
to
this FilterOutputStream. This implementation writes the
buffer
to the target stream.
Parameters
buffer
| the buffer to be written |
Throws
IOException
| If an error occurs attempting to write to this
FilterOutputStream.
|
public
void
write(int oneByte)
Writes the specified byte
oneByte
to this
FilterOutputStream. Only the low order byte of
oneByte
is
written. This implementation writes the byte to the target OutputStream.
Parameters
oneByte
| the byte to be written |
Throws
IOException
| If an error occurs attempting to write to this
FilterOutputStream.
|
public
void
write(byte[] buffer, int offset, int count)
Writes
count
bytes
from the byte array
buffer
starting at
offset
to this
FilterOutputStream. This implementation writes the
buffer
to the target OutputStream.
Parameters
buffer
| the buffer to be written |
offset
| offset in buffer to get bytes |
count
| number of bytes in buffer to write |