@ServerSideProxyAllow
public interface ServerStream
This behaviour is achieved by using the normal proxy/callback mechanisms of
the communication framework, that is, when requesting a
ServerStream a proxy is created at the client and this connects
to the originating stream on the server. The connection remains open until
closing the stream or shutting down the communication.
When transferring a ServerStream as parameter to the server, the
client will be export it, transfer the URI and the server will create a proxy
for the URI/the stream. Note that if the client terminates before the server
closes the stream, the server will not be able to access the stream any
longer since the stream is disconnected. To prevent this behaviour and memory
leaks, the server has to close() the stream eventually.
Unlike a normal input stream, a disconnected ServerStream throws
ServiceConnectionExceptions for every called method instead of
the usual IOException.
| Modifier and Type | Method and Description |
|---|---|
int |
available()
InputStream.available() |
void |
close()
InputStream.close()
This additionally removes the skeleton in the communication framework. |
void |
mark(int readlimit)
InputStream.mark(int) |
boolean |
markSupported()
InputStream.markSupported() |
int |
read()
InputStream.read() |
byte[] |
read(int len)
Resembles
InputStream.read(byte[]) by reading the
designated amount of bytes from the stream. |
void |
reset()
InputStream.reset() |
long |
skip(long n)
InputStream.skip(long) |
int read() throws java.io.IOException
InputStream.read()ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOExceptionbyte[] read(int len)
throws java.io.IOException
InputStream.read(byte[]) by reading the
designated amount of bytes from the stream. If there are less bytes
remaining in the stream, the returned byte array will be correspondingly
shorter. If no bytes remain (java.io.InputStream#read(byte[])
returns -1), null will be returned.ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOExceptionlong skip(long n) throws java.io.IOException
InputStream.skip(long)ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOExceptionint available()
throws java.io.IOException
InputStream.available()ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOException@ServerSideProxyRemove
void close()
throws java.io.IOException
InputStream.close()
This additionally removes the skeleton in the communication framework.ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOExceptionvoid mark(int readlimit)
InputStream.mark(int)ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.void reset()
throws java.io.IOException
InputStream.reset()ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.java.io.IOExceptionboolean markSupported()
InputStream.markSupported()ServiceConnectionException - If the underlying stream cannot be reached any more through the
communication framework, a
ServiceConnectionException will be thrown.