|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
edu.emory.mathcs.util.remote.io.RemoteInputStream
Serializable input stream that reads from an input stream on a remote host, using RMI (or RMIX, or Jini ERI, ...). Since RMI itself can be enabled over various protocols and socket factories, this class allows to tunnel byte streams through a variety of protocols. For example, if used with RMIX, it is possible to tunnel streams via SOAP/HTTP. Typical usage pattern is to create the instance at the server side and then send it to the client via RMI:
InputStream getRemoteStream() throws RemoteException { InputStream source = ...; RemoteInputStreamSrv srv = new RemoteInputStreamSrvImpl(source); // the following line for standard RMI only (not RMIX or JERI) UnicastRemoteObject.exportObject(srv); return new RemoteInputStream(source); }
Constructor Summary | |
RemoteInputStream()
for deserialization only |
|
RemoteInputStream(java.io.InputStream in)
Deprecated. this constructor does not work correctly with standard Java RMI (it only works with RMIX). See this class javadoc for instantiation instructions. |
|
RemoteInputStream(RemoteInputStreamSrv server)
Constructs a new serializable remote input stream reading from the specified stream handle. |
Method Summary | |
int |
available()
|
void |
close()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
void |
readExternal(java.io.ObjectInput in)
|
long |
skip(long n)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RemoteInputStream()
public RemoteInputStream(java.io.InputStream in)
in
- the source streampublic RemoteInputStream(RemoteInputStreamSrv server)
server
- RMI handle to the source streamMethod Detail |
public int read() throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public long skip(long n) throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |