|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--com.ibm.wbi.util.BytePipe
A BytePipe is used to "pipe" bytes from an OutputStream to an InputStream. The BytePipe uses a concept of byte buckets that hold written, which is then flushed to a byte repository for reading. This essentially breaks the stream down into logical byte "buckets" allowing buckets that have already been read to be discarded making the byte streaming process more memory efficient especially when a large quantity of bytes are streamed.
| Constructor Summary | |
BytePipe()
Construct a new BytePipe with a default byte bucket capacity. |
|
BytePipe(int bufferCapacity)
Construct a new BytePipe with the specified byte bucket capacity. |
|
| Method Summary | |
void |
close()
Flush and close the pipe stream making all bytes written available for a read. |
void |
flush()
Flush the pipe stream making all bytes written available for a read. |
java.io.InputStream |
getInputStream()
Get the InputStream to read byte from the Pipe. |
java.io.OutputStream |
getOutputStream()
Get the OutputStream to write bytes to the Pipe. |
void |
write(byte[] b)
Write an array of bytes to the pipe stream. |
void |
write(byte[] b,
int off,
int len)
Write a portion of an array of bytes to the pipe stream. |
void |
write(int b)
Write a single byte to the pipe stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BytePipe()
public BytePipe(int bufferCapacity)
bufferCapacity - The byte bucket capacity.| Method Detail |
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
The - BytePipe OutputStream.
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - The byte.java.io.IOException - If a write error occurs.
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamb - The array of bytes.java.io.IOException - If a write error occurs.
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamb - The array of bytes.off - The offset into b to start from.len - The length from off to write.java.io.IOException - If a write error occurs.
public void flush()
throws java.io.IOException
flush in class java.io.OutputStreamjava.io.IOException - If a stream error occurs.
public void close()
throws java.io.IOException
close in class java.io.OutputStreamjava.io.IOException - If a stream error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||