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.
-
LocalInputStream(String)
- Initialize the input stream and request the file from the relay.
-
available()
- Return number of bytes available for reading.
-
close()
- Close the input stream.
-
isEOF()
- Check if the end of the file has been reached.
-
read()
- Read one byte from the input stream
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
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
close
public void close() throws IOException
- Close the input stream.
- Overrides:
- close in class InputStream
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
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