|
Back to the RMI Plug-in for Eclipse
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.InputStream
java.io.FileInputStream
demo.rmi.filesystem.server.RemoteInputStreamImpl
public class RemoteInputStreamImpl
Implementation of a remote input stream. It is created by the server
using a local file as an argument.
This class extends FileInputStream only as a convenience,
we could extend UnicastRemoteObject and hold a reference to
the FileInputStream in a field. Since RemoteException is
a subclass of IOException the method declarations are compatible
with their "super" implementations. However, all methods must catch the
IOException returned by the super implementation and wrap it with
a RemoteException.
IRemoteFile.getInputStream()| Constructor Summary | |
|---|---|
RemoteInputStreamImpl(File file)
Create a new RemoteInputStream that reads from a local (server) file. |
|
| Method Summary | |
|---|---|
int |
available()
|
void |
close()
|
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
Read a single byte from the stream. |
byte[] |
read(int count)
Read count bytes from the stream. |
void |
reset()
|
long |
skip(long n)
|
| Methods inherited from class java.io.FileInputStream |
|---|
finalize, getChannel, getFD, read, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteInputStreamImpl(File file)
throws RemoteException,
FileNotFoundException
RemoteException
FileNotFoundExceptionIRemoteFile.getInputStream()| Method Detail |
|---|
public int available()
throws RemoteException
available in interface IRemoteInputStreamavailable in class FileInputStreamRemoteExceptionInputStream.available()
public void close()
throws RemoteException
close in interface IRemoteInputStreamclose in interface Closeableclose in class FileInputStreamRemoteExceptionInputStream.close()public void mark(int readlimit)
mark in interface IRemoteInputStreammark in class InputStreamInputStream.mark(int)public boolean markSupported()
markSupported in interface IRemoteInputStreammarkSupported in class InputStreamInputStream.markSupported()
public int read()
throws RemoteException
IRemoteInputStream
read in interface IRemoteInputStreamread in class FileInputStreamRemoteExceptionInputStream.read()
public byte[] read(int count)
throws RemoteException
IRemoteInputStreamcount bytes from the stream.
We can't have the same signature as InputStream.read(byte[], int, int)
because if the array is an argument it won't be copied back to
the client.
read in interface IRemoteInputStreamcount - the maximum number of bytes to read.
null if EOF reached.
RemoteException
public void reset()
throws RemoteException
reset in interface IRemoteInputStreamreset in class InputStreamRemoteExceptionInputStream.reset()
public long skip(long n)
throws RemoteException
skip in interface IRemoteInputStreamskip in class FileInputStreamRemoteExceptionInputStream.skip(long)
|
Back to the RMI Plug-in for Eclipse
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
© 2002-12 Genady Beryozkin, rmi-info@genady.net. Read our Privacy policy. Hosted on RimuHosting. Visit Javalobby.