gausssoft.io
Class StatusOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--gausssoft.io.StatusOutputStream
- Direct Known Subclasses:
- ChunkingOutputStream
- public class StatusOutputStream
- extends FilterOutputStream
This class is used to indicate the status of another OutputStream
.
Currently, this class only performs two functions:
- Counts the number of bytes that pass through the stream.
- Indicates when the stream has been closed.
A stream is considered to be closed when it has been closed via the close()
method, or an IOException is thrown.
- Since:
- GSDK 1.1
- Author:
- Allan Crooks
- See Also:
StatusInputStream
Method Summary |
void |
close()
|
void |
flush()
|
long |
getCount()
Returns the number of bytes that have passed through the stream. |
boolean |
isClosed()
Returns true if the underlying stream is closed. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StatusOutputStream
public StatusOutputStream(OutputStream out)
- Creates a new StatusOutputStream.
- Parameters:
out
- The OutputStream to use.- Throws:
NullPointerException
- If out
is null
.
write
public void write(int b)
throws IOException
- Overrides:
write
in class FilterOutputStream
write
public void write(byte[] b)
throws IOException
- Overrides:
write
in class FilterOutputStream
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class FilterOutputStream
flush
public void flush()
throws IOException
- Overrides:
flush
in class FilterOutputStream
close
public void close()
throws IOException
- Overrides:
close
in class FilterOutputStream
isClosed
public final boolean isClosed()
- Returns
true
if the underlying stream is closed.
- Returns:
true
if the underlying stream is closed.
getCount
public final long getCount()
- Returns the number of bytes that have passed through the stream.
- Returns:
- The number of bytes that have passed through the stream.