|
||||||||||
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)
|
Method Summary | |
---|---|
void |
close()
|
void |
closeInternal()
nonblocking close |
(package private) void |
destroy()
|
void |
flush()
Flush the data already queued up, blocking until it has been delivered. |
(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(java.io.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)
Method Detail |
---|
public void setWriteTimeout(int ms)
public int getWriteTimeout()
public void setBufferSize(int size)
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- if the write fails
java.io.InterruptedIOException
- if the write times outpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |