public class TimedOutputStream extends FilterOutputStream
out
Constructor and Description |
---|
TimedOutputStream(OutputStream out)
Creates an output stream filter built on top of the specified
underlying output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
write(byte[] b)
Writes
b.length bytes to this output stream. |
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified
byte array starting at offset off to
this output stream. |
void |
write(int b)
Writes the specified
byte to this output stream. |
close, flush
public TimedOutputStream(OutputStream out)
out
- the underlying output stream to be assigned to
the field this.out for later use, or
null
if this instance is to be
created without an underlying stream.public void write(int b) throws IOException
byte
to this output stream.
The write
method of FilterOutputStream
calls the write
method of its underlying output stream,
that is, it performs out.write(b).
Implements the abstract write method of OutputStream.write
in class FilterOutputStream
b
- the byte
.IOException
- IOException
if an I/O error occurs.public void write(byte[] b) throws IOException
b.length
bytes to this output stream.
The write
method of FilterOutputStream
calls its write
method of three arguments with the
arguments b
, 0
, and
b.length
.
Note that this method does not call the one-argument
write
method of its underlying stream with the single
argument b
.write
in class FilterOutputStream
b
- the data to be written.IOException
- IOException
if an I/O error occurs.FilterOutputStream.write(byte[], int, int)
public void write(byte[] b, int off, int len) throws IOException
len
bytes from the specified
byte
array starting at offset off
to
this output stream.
As suggested by the FilterOutputStream superclass, this method
implements as more efficient task by calling the underlying output
stream directly.write
in class FilterOutputStream
b
- The bytes to writeoff
- The offset into the byte arraylen
- The length to writeIOException
- If there is an error writing