Class sfclasses.LocalInputStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sfclasses.LocalInputStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----sfclasses.LocalInputStream

public class LocalInputStream
extends InputStream
This class implements an input stream to read data from a local file via the relay. It uses the I/O functions implemented in the Communicator class. Filter streams can be used on top of this stream to enhance functionality.

Constructor Index

 o LocalInputStream(String)
Initialize the input stream and request the file from the relay.

Method Index

 o available()
Return number of bytes available for reading.
 o close()
Close the input stream.
 o isEOF()
Check if the end of the file has been reached.
 o read()
Read one byte from the input stream

Constructors

 o LocalInputStream
  public LocalInputStream(String filename)
Initialize the input stream and request the file from the relay.
Parameters:
filename - Name of the local file including the complete path

Methods

 o read
  public int read() throws IOException
Read one byte from the input stream
Returns:
read byte or -1 on error
Overrides:
read in class InputStream
 o close
  public void close() throws IOException
Close the input stream.
Overrides:
close in class InputStream
 o available
  public int available()
Return number of bytes available for reading. If the buffer is empty but the end of the file is not reached, 1 is returned.
Overrides:
available in class InputStream
 o isEOF
  public boolean isEOF()
Check if the end of the file has been reached.
Returns:
true if EOF, false otherwise

All Packages  Class Hierarchy  This Package  Previous  Next  Index