ostore.network
Class ConnectionStream
java.lang.Object
|
+--ostore.network.ConnectionStream
- public class ConnectionStream
- extends Object
Used by the network in place of an aSocketInputStream. This is done for
two reasons. First, the aSocketInputStream never frees any data, and it
wasn't immediately clear how to make it do so, mainly b/c the
implementation is poor, using a array of arrays rather than a linked
list of arrays. I couldn't immediately figure out how to fix it.
Second, for small messages that fit within a packet, it's interface
didn't allow for the original packet byte array to be returned to the
caller, whereas this classes interface does. We thus avoid a copy for
small messages.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionStream
public ConnectionStream()
get_next_message_buffer
public InputBuffer get_next_message_buffer()
message_available
public boolean message_available()
next_message_size
public int next_message_size()
add_packet
public void add_packet(ATcpInPacket packet)