|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.ow2.petals.transport.platform.nio.util.stream.queue.QueueOutputStream
public class QueueOutputStream
This class implements an output stream in which the data are written into a byte array queue. Each write creates a new entry in the queue. The new entry is a copy of the buffer to write.
This class is thread-safe, and should be used with QueueInputStream.
Closing a QueueOutputStream has no effect. For performance reasons (no check is done), the methods in this class can be called after the stream has been closed without generating an IOException.
| Field Summary | |
|---|---|
protected java.util.Queue<byte[]> |
bufferList
|
| Constructor Summary | |
|---|---|
QueueOutputStream()
|
|
| Method Summary | |
|---|---|
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at
offset off to this byte array queue output stream. |
void |
write(int b)
Writes the specified byte to this byte array linked list output stream. |
| Methods inherited from class java.io.OutputStream |
|---|
close, flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Queue<byte[]> bufferList
| Constructor Detail |
|---|
public QueueOutputStream()
| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - the byte to be written.
java.io.IOExceptionOutputStream#write(int)}
public void write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at
offset off to this byte array queue output stream.
Note:
off == 0 && len == b.length), it is added by
reference in the queue,
write in class java.io.OutputStreamb - the data buffer to writer.off - the start offset in the data.len - the number of bytes to write.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||