| java.lang.Object java.io.OutputStream org.apache.commons.httpclient.ChunkedOutputStream
ChunkedOutputStream | public class ChunkedOutputStream extends OutputStream (Code) | | Implements HTTP chunking support. Writes are buffered to an internal buffer (2048 default size).
Chunks are guaranteed to be at least as large as the buffer size (except for the last chunk).
author: Mohammad Rezaei, Goldman, Sachs & Co. |
Method Summary | |
public void | close() Finishes writing to the underlying stream, but does NOT close the underlying stream. | public void | finish() Must be called to ensure the internal cache is flushed and the closing chunk is written. | public void | flush() Flushes the underlying stream, but leaves the internal buffer alone. | protected void | flushCache() | protected void | flushCacheWithAppend(byte bufferToAppend, int off, int len) | public void | write(int b) Write the specified byte to our output stream.
Note: Avoid this method as it will cause an inefficient single byte chunk. | public void | write(byte b) Writes the array. | public void | write(byte src, int off, int len) | protected void | writeClosingChunk() |
ChunkedOutputStream | public ChunkedOutputStream(OutputStream stream, int bufferSize) throws IOException(Code) | | Wraps a stream and chunks the output.
Parameters: stream - to wrap Parameters: bufferSize - minimum chunk size (excluding last chunk) throws: IOException - since: 3.0 |
ChunkedOutputStream | public ChunkedOutputStream(OutputStream stream) throws IOException(Code) | | Wraps a stream and chunks the output. The default buffer size of 2048 was chosen because
the chunk overhead is less than 0.5%
Parameters: stream - throws: IOException - |
close | public void close() throws IOException(Code) | | Finishes writing to the underlying stream, but does NOT close the underlying stream.
throws: IOException - |
finish | public void finish() throws IOException(Code) | | Must be called to ensure the internal cache is flushed and the closing chunk is written.
throws: IOException - since: 3.0 |
flush | public void flush() throws IOException(Code) | | Flushes the underlying stream, but leaves the internal buffer alone.
throws: IOException - |
flushCache | protected void flushCache() throws IOException(Code) | | Writes the cache out onto the underlying stream
throws: IOException - since: 3.0 |
flushCacheWithAppend | protected void flushCacheWithAppend(byte bufferToAppend, int off, int len) throws IOException(Code) | | Writes the cache and bufferToAppend to the underlying stream
as one large chunk
Parameters: bufferToAppend - Parameters: off - Parameters: len - throws: IOException - since: 3.0 |
write | public void write(int b) throws IOException(Code) | | Write the specified byte to our output stream.
Note: Avoid this method as it will cause an inefficient single byte chunk.
Use write (byte[], int, int) instead.
Parameters: b - The byte to be written throws: IOException - if an input/output error occurs |
write | public void write(byte b) throws IOException(Code) | | Writes the array. If the array does not fit within the buffer, it is
not split, but rather written out as one large chunk.
Parameters: b - throws: IOException - since: 3.0 |
|
|