jcontrol.io
Class InputStream

java.lang.Object
  extended by jcontrol.io.InputStream
Direct Known Subclasses:
ByteArrayInputStream, DataInputStream

public abstract class InputStream
extends Object


Constructor Summary
InputStream()
           
 
Method Summary
abstract  int available()
          Returns the number of bytes immediately available for reading from this stream.
abstract  void close()
          Closes the stream.
abstract  void mark(int readlimit)
           
abstract  boolean markSupported()
          Checks if mark() and reset() are supported by this stream.
abstract  int read()
          Reads a single byte from the stream.
 void read(byte[] b)
          Reads an array of bytes from the stream.
abstract  void read(byte[] b, int start, int length)
          Reads an array of bytes from the stream.
abstract  void reset()
           
abstract  void skip(int length)
          Skips data from the stream.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notifyAll, toString, wait
 

Constructor Detail

InputStream

public InputStream()
Method Detail

available

public abstract int available()
                       throws IOException
Returns the number of bytes immediately available for reading from this stream.

Returns:
number of bytes immediately readable
Throws:
IOException - occurs on I/O errors or when the stream is closed

close

public abstract void close()
                    throws IOException
Closes the stream.

Throws:
IOException - if stream is already closed

markSupported

public abstract boolean markSupported()
Checks if mark() and reset() are supported by this stream.

Returns:
true if supported, false if not

mark

public abstract void mark(int readlimit)

reset

public abstract void reset()
                    throws IOException
Throws:
IOException

read

public abstract int read()
                  throws IOException
Reads a single byte from the stream.

Returns:
byte value
Throws:
IOException - occurs on I/O errors or when the stream is closed

read

public void read(byte[] b)
          throws IOException
Reads an array of bytes from the stream. Data is placed in the given array. The method attempts to read as many bytes as fit into the array.

Parameters:
b - array where data is stored
Throws:
IOException - occurs on I/O errors or when the stream is closed

read

public abstract void read(byte[] b,
                          int start,
                          int length)
                   throws IOException
Reads an array of bytes from the stream. Data is placed at the specified location in the given array.

Parameters:
b - array where data is stored
start - offset within the data array
length - number of bytes to read
Throws:
IOException - occurs on I/O errors or when the stream is closed

skip

public abstract void skip(int length)
                   throws IOException
Skips data from the stream.

Parameters:
length - number of bytes to skip
Throws:
IOException - occurs on I/O errors or when the stream is closed