Class ServerInputStream
- java.lang.Object
-
- de.aristaflow.adept2.model.common.communication.ServerInputStream
-
- All Implemented Interfaces:
ServerStream
- Direct Known Subclasses:
ServerUDTInputStream
public class ServerInputStream extends Object implements ServerStream
This is a simple wrapper for anInputStream
asServerStream
which allows for keeping anInputStream
locally and use it remotely.- Author:
- Ulrich Kreher
-
-
Constructor Summary
Constructors Constructor Description ServerInputStream(InputStream in)
Creates a newServerInputStream
providing the content of the designated stream incrementally on client side.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
InputStream.close()
This additionally removes the skeleton in the communication framework.void
mark(int readlimit)
boolean
markSupported()
int
read()
byte[]
read(int len)
ResemblesInputStream.read(byte[])
by reading the designated amount of bytes from the stream.void
reset()
long
skip(long n)
-
-
-
Constructor Detail
-
ServerInputStream
public ServerInputStream(InputStream in)
Creates a newServerInputStream
providing the content of the designated stream incrementally on client side. Note that this stream as well as the wrappedInputStream
will be closed by the remote site. Therefore you should only close this stream (or the wrappedInputStream
) if you are sure that the remote side has not closed it and will not close it, for instance since it disconnected abruptly.- Parameters:
in
- The stream of which the content will be provided incrementally on client side. This stream will be closed by the remote side.
-
-
Method Detail
-
read
public int read() throws IOException
Description copied from interface:ServerStream
- Specified by:
read
in interfaceServerStream
- Throws:
IOException
-
read
public byte[] read(int len) throws IOException
Description copied from interface:ServerStream
ResemblesInputStream.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.- Specified by:
read
in interfaceServerStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
Description copied from interface:ServerStream
- Specified by:
skip
in interfaceServerStream
- Throws:
IOException
-
available
public int available() throws IOException
Description copied from interface:ServerStream
- Specified by:
available
in interfaceServerStream
- Throws:
IOException
-
close
public void close() throws IOException
Description copied from interface:ServerStream
InputStream.close()
This additionally removes the skeleton in the communication framework.- Specified by:
close
in interfaceServerStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
Description copied from interface:ServerStream
- Specified by:
mark
in interfaceServerStream
-
reset
public void reset() throws IOException
Description copied from interface:ServerStream
- Specified by:
reset
in interfaceServerStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
Description copied from interface:ServerStream
- Specified by:
markSupported
in interfaceServerStream
-
-