|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
net.i2p.client.streaming.MessageOutputStream
class MessageOutputStream
A stream that we can shove data into that fires off those bytes on flush or when the buffer is full. It also blocks according to the data receiver's needs.
MessageOutputStream -> ConnectionDataReceiver -> Connection -> PacketQueue -> I2PSession
Nested Class Summary | |
---|---|
static interface |
MessageOutputStream.DataReceiver
Define a component to receive data flushed from this stream |
static interface |
MessageOutputStream.WriteStatus
Define a way to detect the status of a write |
Constructor Summary | |
---|---|
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize)
|
|
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize,
int passiveFlushDelay)
|
Method Summary | |
---|---|
void |
close()
This does a flush, and BLOCKS until the CLOSE packet is acked. |
void |
closeInternal()
nonblocking close - Only for use inside package |
(package private) void |
destroy()
|
void |
flush()
Flush the data already queued up, blocking only if the outbound window is full. |
(package private) void |
flushAvailable(MessageOutputStream.DataReceiver target)
called whenever the engine wants to push more data to the peer |
(package private) void |
flushAvailable(MessageOutputStream.DataReceiver target,
boolean blocking)
|
boolean |
getClosed()
|
int |
getWriteTimeout()
|
void |
setBufferSize(int size)
|
void |
setWriteTimeout(int ms)
|
(package private) void |
streamErrorOccurred(IOException ioe)
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageOutputStream(I2PAppContext ctx, SimpleTimer2 timer, MessageOutputStream.DataReceiver receiver, int bufSize)
public MessageOutputStream(I2PAppContext ctx, SimpleTimer2 timer, MessageOutputStream.DataReceiver receiver, int bufSize, int passiveFlushDelay)
Method Detail |
---|
public void setWriteTimeout(int ms)
public int getWriteTimeout()
public void setBufferSize(int size)
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- if the write failspublic void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void closeInternal()
public boolean getClosed()
void streamErrorOccurred(IOException ioe)
void flushAvailable(MessageOutputStream.DataReceiver target) throws IOException
IOException
void flushAvailable(MessageOutputStream.DataReceiver target, boolean blocking) throws IOException
IOException
void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |