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:

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

Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
StatusInputStream(InputStream in)
          Creates a new StatusInputStream.
 
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.io.FilterInputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatusInputStream

public StatusInputStream(InputStream in)
Creates a new StatusInputStream.
Parameters:
in - The InputStream to use.
Throws:
NullPointerException - If in is null.
Method Detail

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.