|
||||||||||
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
public 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.
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,
MessageOutputStream.DataReceiver receiver)
|
|
MessageOutputStream(I2PAppContext ctx,
MessageOutputStream.DataReceiver receiver,
int bufSize)
|
|
MessageOutputStream(I2PAppContext ctx,
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 - Use outside of this package is deprecated, should be made package local |
(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, MessageOutputStream.DataReceiver receiver)
public MessageOutputStream(I2PAppContext ctx, MessageOutputStream.DataReceiver receiver, int bufSize)
public MessageOutputStream(I2PAppContext ctx, 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 |