All Packages Class Hierarchy This Package Previous Next Index
Class jnfs.RemoteFileInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----jnfs.RemoteFileInputStream
- public class RemoteFileInputStream
- extends InputStream
- implements Serializable, Runnable
An input stream for reading data from a file remotely. Conforms to
the same interface as an InputStream
.
- Version:
- $Id: RemoteFileInputStream.java,v 2.8 1997/05/20 17:59:39 mjr Exp $
- Author:
- Michael John Radwin
- See Also:
- FileServer, InputStream
-
available()
- Returns the number of bytes that can be read from this file input
stream without blocking.
-
close()
- Closes this file input stream and releases any system resources
associated with the stream.
-
finalize()
- Ensures that the
close
method of this file input stream is
called when there are no more references to it.
-
read()
- Reads a byte of data from this input stream.
-
read(byte[], int, int)
- Reads up to
len
bytes of data from this input stream
into an array of bytes.
-
run()
- Used internally by the
RemoteFileInputStream
to prefetch
data in a separate thread.
-
skip(long)
- Skips over and discards
n
bytes of data from the
input stream.
read
public synchronized int read() throws IOException
- Reads a byte of data from this input stream. This method blocks
if no input is yet available.
- Returns:
- the next byte of data, or
-1
if the end of the
file is reached.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- read in class InputStream
read
public synchronized int read(byte b[],
int off,
int len) throws IOException
- Reads up to
len
bytes of data from this input stream
into an array of bytes. This method blocks until some input is
available.
- Parameters:
- b - the buffer into which the data is read.
- off - the start offset of the data.
- len - the maximum number of bytes read.
- Returns:
- the total number of bytes read into the buffer, or
-1
if there is no more data because the end of
the file has been reached.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- read in class InputStream
skip
public synchronized long skip(long n) throws IOException
- Skips over and discards
n
bytes of data from the
input stream. The skip
method may, for a variety of
reasons, end up skipping over some smaller number of bytes,
possibly 0
. The actual number of bytes skipped is returned.
- Parameters:
- n - the number of bytes to be skipped.
- Returns:
- the actual number of bytes skipped.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- skip in class InputStream
available
public synchronized int available() throws IOException
- Returns the number of bytes that can be read from this file input
stream without blocking.
- Returns:
- the number of bytes that can be read from this file input
stream without blocking.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- available in class InputStream
close
public synchronized void close() throws IOException
- Closes this file input stream and releases any system resources
associated with the stream.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- close in class InputStream
finalize
protected void finalize() throws IOException
- Ensures that the
close
method of this file input stream is
called when there are no more references to it.
- Throws: IOException
- if an I/O error occurs.
- Overrides:
- finalize in class Object
- See Also:
- close
run
public void run()
- Used internally by the
RemoteFileInputStream
to prefetch
data in a separate thread.
All Packages Class Hierarchy This Package Previous Next Index