net.i2p.client.streaming
class MessageInputStream extends InputStream
Constructor and Description |
---|
MessageInputStream(I2PAppContext ctx) |
Modifier and Type | Method and Description |
---|---|
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(IOException ioe)
Stream b0rked, die with the given error
|
void |
updateAcks(PacketLocal packet) |
mark, markSupported, reset, skip
public MessageInputStream(I2PAppContext ctx)
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)
messageId
- ID of the messagepayload
- message payloadpublic int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] target) throws IOException
read
in class InputStream
IOException
public int read(byte[] target, int offset, int length) throws IOException
read
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public int getTotalQueuedSize()
public int getTotalReadySize()
public void close()
close
in interface Closeable
close
in class InputStream
void streamErrorOccurred(IOException ioe)