gausssoft.io
Class StatusInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--gausssoft.io.StatusInputStream
- Direct Known Subclasses:
- ChunkingInputStream
- public class StatusInputStream
- extends FilterInputStream
This class is used to indicate the status of another InputStream
.
Currently, this class only performs three functions:
- Counts the number of bytes that pass to the stream.
- Indicates when the stream has been closed.
- Detects when a stream has no more data.
A stream is considered to be empty when it either fails to return valid data, throws an
IOException, or is closed.
- Since:
- GSDK 1.1
- Author:
- Allan Crooks
- See Also:
StatusOutputStream
Method Summary |
int |
available()
|
void |
close()
|
long |
getCount()
Returns the number of bytes that have passed through the stream. |
boolean |
isClosed()
Returns true if the underlying stream is closed. |
boolean |
isEmpty()
Returns true if the underlying stream is empty. |
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long skip)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StatusInputStream
public StatusInputStream(InputStream in)
- Creates a new StatusInputStream.
- Parameters:
in
- The InputStream to use.- Throws:
NullPointerException
- If in
is null
.
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
read
public int read(byte[] b)
throws IOException
- Overrides:
read
in class FilterInputStream
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
skip
public long skip(long skip)
throws IOException
- Overrides:
skip
in class FilterInputStream
available
public int available()
throws IOException
- Overrides:
available
in class FilterInputStream
close
public void close()
throws IOException
- Overrides:
close
in class FilterInputStream
isClosed
public final boolean isClosed()
- Returns
true
if the underlying stream is closed.
- Returns:
true
if the underlying stream is closed.
isEmpty
public final boolean isEmpty()
- Returns
true
if the underlying stream is empty.
- Returns:
true
if the underlying stream is empty.
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.