|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
net.i2p.client.streaming.MessageInputStream
public class MessageInputStream
Stream that can be given messages out of order yet present them in order.
Constructor Summary | |
---|---|
MessageInputStream(I2PAppContext ctx)
|
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
void |
closeReceived()
|
long |
getHighestBlockId()
|
long |
getHighestReadyBockId()
What is the highest block ID we've completely received through? |
long[] |
getNacks()
Retrieve the message IDs that are holes in our sequence - ones past the highest ready ID and below the highest received message ID. |
int |
getOutOfOrderBlockCount()
how many blocks have we received that we still have holes before? |
long[] |
getOutOfOrderBlocks()
Ascending list of block IDs greater than the highest ready block ID, or null if there aren't any. |
int |
getReadTimeout()
how long a read() call should block (if less than 0, block indefinitely, but if it is 0, do not block at all) |
int |
getTotalQueuedSize()
How many bytes are queued up for reading (or sitting in the out-of-order buffer)? |
int |
getTotalReadySize()
|
boolean |
messageReceived(long messageId,
ByteArray payload)
A new message has arrived - toss it on the appropriate queue (moving previously pending messages to the ready queue if it fills the gap, etc). |
void |
notifyActivity()
|
int |
read()
|
int |
read(byte[] target)
|
int |
read(byte[] target,
int offset,
int length)
|
void |
setReadTimeout(int timeout)
|
(package private) void |
streamErrorOccurred(java.io.IOException ioe)
Stream b0rked, die with the given error |
void |
updateAcks(PacketLocal packet)
|
Methods inherited from class java.io.InputStream |
---|
mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageInputStream(I2PAppContext ctx)
Method Detail |
---|
public long getHighestReadyBockId()
public long getHighestBlockId()
public long[] getNacks()
public void updateAcks(PacketLocal packet)
public long[] getOutOfOrderBlocks()
public int getOutOfOrderBlockCount()
public int getReadTimeout()
public void setReadTimeout(int timeout)
public void closeReceived()
public void notifyActivity()
public boolean messageReceived(long messageId, ByteArray payload)
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] target) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] target, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public int getTotalQueuedSize()
public int getTotalReadySize()
public void close()
close
in interface java.io.Closeable
close
in class java.io.InputStream
void streamErrorOccurred(java.io.IOException ioe)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |