| seda.sandStorm.lib.util.MultiByteArrayInputStream seda.sandStorm.lib.aSocket.aSocketInputStream
aSocketInputStream | public class aSocketInputStream extends MultiByteArrayInputStream (Code) | | This is a utility class that allows you to push multiple ATcpInPackets
in, and read bytes out as a stream. This is meant to be a convenience
for performing packet processing using the aSocket interfaces.
This class also takes care of reordering packets according to the
ATcpInPacket sequence number; that is, if multiple threads in a stage
are receiving ATcpInPackets for the same connection, the aSocketInputStream
will internally reorder those packets.
author: Matt Welsh See Also: MultiByteArrayInputStream |
Inner Class :class seqNumComparator implements Comparator | |
Constructor Summary | |
public | aSocketInputStream() Create an aSocketInputStream with an initial sequence number of 1. | public | aSocketInputStream(long initialSeqNum) Create an aSocketInputStream using the given initial sequence number. |
Method Summary | |
public synchronized void | addPacket(ATcpInPacket pkt) Add a packet to this aSocketInputStream. | public synchronized void | clear() Reinitialize the state of this input stream, clearing all
internal data and pointers. | public synchronized long | getNextSequenceNumber() Return the next expected sequence number. |
aSocketInputStream | public aSocketInputStream()(Code) | | Create an aSocketInputStream with an initial sequence number of 1.
|
aSocketInputStream | public aSocketInputStream(long initialSeqNum)(Code) | | Create an aSocketInputStream using the given initial sequence number.
|
addPacket | public synchronized void addPacket(ATcpInPacket pkt)(Code) | | Add a packet to this aSocketInputStream. Reorders packets internally
so that bytes will be read from this InputStream according to the
sequence number order of the packets.
|
clear | public synchronized void clear()(Code) | | Reinitialize the state of this input stream, clearing all
internal data and pointers. The next sequence number will
be preserved.
|
getNextSequenceNumber | public synchronized long getNextSequenceNumber()(Code) | | Return the next expected sequence number.
|
|
|