class MessageOutputStream extends OutputStream
MessageOutputStream -> ConnectionDataReceiver -> Connection -> PacketQueue -> I2PSession
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize) |
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize,
int passiveFlushDelay) |
Modifier and Type | Method and Description |
---|---|
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) |
public MessageOutputStream(I2PAppContext ctx, SimpleTimer2 timer, MessageOutputStream.DataReceiver receiver, int bufSize)
public MessageOutputStream(I2PAppContext ctx, SimpleTimer2 timer, MessageOutputStream.DataReceiver receiver, int bufSize, int passiveFlushDelay)
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 interface AutoCloseable
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()