Package jadex.bridge
Interface IInputConnection
-
- All Superinterfaces:
IConnection
- All Known Implementing Classes:
InputConnection
,ServiceInputConnection
,ServiceInputConnectionProxy
public interface IInputConnection extends IConnection
Interface for input connection stream.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ISubscriptionIntermediateFuture<byte[]>
aread()
Asynchronous read.int
available()
Get the number of available bytes.int
read()
Non-blocking read.int
read(byte[] buffer)
Non-blocking read.ISubscriptionIntermediateFuture<java.lang.Long>
writeToOutputStream(java.io.OutputStream os, IExternalAccess component)
Write all data from the connection to the output stream.-
Methods inherited from interface jadex.bridge.IConnection
close, getConnectionId, getInitiator, getNonFunctionalProperties, getParticipant
-
-
-
-
Method Detail
-
read
int read()
Non-blocking read. Tries to read the next byte.- Returns:
- The next byte or -1 if the end of the stream has been reached.
-
read
int read(byte[] buffer)
Non-blocking read. Tries to fill the buffer from the stream.- Parameters:
buffer
- The buffer to read in.- Returns:
- The number of bytes that could be read into the buffer.
-
aread
ISubscriptionIntermediateFuture<byte[]> aread()
Asynchronous read.- Returns:
- Bytes one by one till end of stream or closed.
-
available
int available()
Get the number of available bytes.- Returns:
- The number of available bytes.
-
writeToOutputStream
ISubscriptionIntermediateFuture<java.lang.Long> writeToOutputStream(java.io.OutputStream os, IExternalAccess component)
Write all data from the connection to the output stream. The result is an intermediate future that reports back the size that was read. It can also be used to terminate reading.- Parameters:
is
- The input stream.component
- The component.
-
-