public class InputConnection extends AbstractConnection implements IInputConnection
Modifier and Type | Field and Description |
---|---|
protected java.util.List<byte[]> |
data
The data.
|
protected SubscriptionIntermediateFuture<byte[]> |
ifuture
The read futures.
|
protected int |
offset
The offset (startvalue of current first row).
|
protected Future<java.lang.Byte> |
ofuture |
protected int |
position
The position.
|
protected int |
size
The size.
|
ch, closed, closing, id, ini, inited, initiator, input, participant
Constructor and Description |
---|
InputConnection(IComponentIdentifier sender,
IComponentIdentifier receiver,
int id,
boolean initiator,
IAbstractConnectionHandler ch)
Create a new input connection.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(byte[] data)
Add data to the internal data buffer.
|
ISubscriptionIntermediateFuture<byte[]> |
aread()
Asynchronous read.
|
IFuture<java.lang.Byte> |
areadNext()
Asynchronous read.
|
int |
available()
Get the number of available bytes.
|
protected void |
dataRead() |
byte[] |
getNextByteArray()
Get the next data byte array.
|
int |
getStoredDataSize()
Get the size of the stored data.
|
protected int |
internalRead()
Non-blocking read.
|
int |
read()
Non-blocking read.
|
int |
read(byte[] buffer)
Non-blocking read.
|
void |
setClosed()
Set the stream to be closed.
|
ISubscriptionIntermediateFuture<java.lang.Long> |
writeToOutputStream(java.io.OutputStream os,
IExternalAccess component)
Read all data from output stream to the connection.
|
close, getConnectionHandler, getConnectionId, getInitiator, getNonFunctionalProperties, getParticipant, isClosed, isClosing, isInited, isInitiatorSide, isInputConnection, setClosing, setInited
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getConnectionId, getInitiator, getNonFunctionalProperties, getParticipant
protected java.util.List<byte[]> data
protected int offset
protected int position
protected int size
protected SubscriptionIntermediateFuture<byte[]> ifuture
protected Future<java.lang.Byte> ofuture
public InputConnection(IComponentIdentifier sender, IComponentIdentifier receiver, int id, boolean initiator, IAbstractConnectionHandler ch)
public int read()
read
in interface IInputConnection
public int read(byte[] buffer)
read
in interface IInputConnection
buffer
- The buffer to read in.protected int internalRead()
exception
- if end of stream has been reached.public byte[] getNextByteArray()
public ISubscriptionIntermediateFuture<byte[]> aread()
aread
in interface IInputConnection
public IFuture<java.lang.Byte> areadNext()
public int available()
available
in interface IInputConnection
public void addData(byte[] data)
data
- The data to add.
If stream is closed adding data is not allowed.public void setClosed()
setClosed
in class AbstractConnection
public int getStoredDataSize()
protected void dataRead()
public ISubscriptionIntermediateFuture<java.lang.Long> writeToOutputStream(java.io.OutputStream os, IExternalAccess component)
writeToOutputStream
in interface IInputConnection
is
- The input stream.component
- The component.