class MessageOutputStream
extends java.io.OutputStream
MessageOutputStream -> ConnectionDataReceiver -> Connection -> PacketQueue -> I2PSession
修飾子とタイプ | クラス | 説明 |
---|---|---|
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
|
コンストラクタ | 説明 |
---|---|
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize) |
|
MessageOutputStream(I2PAppContext ctx,
SimpleTimer2 timer,
MessageOutputStream.DataReceiver receiver,
int bufSize,
int passiveFlushDelay) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
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) |
Caller should enforce a sane minimum.
|
void |
setWriteTimeout(int ms) |
|
(package private) void |
streamErrorOccurred(java.io.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)
size
- must be greater than 0, and smaller than or equal to bufSize in constructorpublic void write(byte[] b) throws java.io.IOException
write
クラス内 java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
クラス内 java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
クラス内 java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
クラス内 java.io.OutputStream
java.io.IOException
- if the write failspublic void close() throws java.io.IOException
close
クラス内 java.io.OutputStream
java.io.IOException
public void closeInternal()
public boolean getClosed()
void streamErrorOccurred(java.io.IOException ioe)
void flushAvailable(MessageOutputStream.DataReceiver target) throws java.io.IOException
java.io.IOException
void flushAvailable(MessageOutputStream.DataReceiver target, boolean blocking) throws java.io.IOException
java.io.IOException
void destroy()