|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
edu.emory.mathcs.util.remote.io.RemoteOutputStream
Serializable output stream that writes to an output stream on a remote host, using RMI. 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:
OutputStream getRemoteStream() throws RemoteException { OutputStream sink = ...; RemoteOutputStreamSrv srv = new RemoteOutputStreamSrvImpl(sink); // the following line for standard RMI only (not RMIX or JERI) UnicastRemoteObject.exportObject(srv); return new RemoteOutputStream(srv); }
Constructor Summary | |
RemoteOutputStream()
for deserialization only |
|
RemoteOutputStream(java.io.OutputStream out)
Deprecated. this constructor does not work correctly with standard Java RMI (it only works with RMIX). See this class javadoc for instantiation instructions. |
|
RemoteOutputStream(RemoteOutputStreamSrv server)
Constructs a new serializable remote output stream that writes to the specified stream handle. |
Method Summary | |
void |
close()
|
void |
flush()
|
void |
readExternal(java.io.ObjectInput in)
|
void |
write(byte[] buf)
|
void |
write(byte[] buf,
int off,
int len)
|
void |
write(int b)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RemoteOutputStream()
public RemoteOutputStream(java.io.OutputStream out)
out
- the sink streampublic RemoteOutputStream(RemoteOutputStreamSrv server)
server
- RMI handle to the source streamMethod Detail |
public void write(int b) throws java.io.IOException
java.io.IOException
public void write(byte[] buf) throws java.io.IOException
java.io.IOException
public void write(byte[] buf, int off, int len) throws java.io.IOException
java.io.IOException
public void flush() 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 |