org.apache.commons.httpclient
public class ChunkedOutputStream extends OutputStream
Constructor Summary | |
---|---|
ChunkedOutputStream(OutputStream stream, int bufferSize)
Wraps a stream and chunks the output. | |
ChunkedOutputStream(OutputStream stream)
Wraps a stream and chunks the output. |
Method Summary | |
---|---|
void | close()
Finishes writing to the underlying stream, but does NOT close the underlying stream. |
void | finish()
Must be called to ensure the internal cache is flushed and the closing chunk is written. |
void | flush()
Flushes the underlying stream, but leaves the internal buffer alone. |
protected void | flushCache()
Writes the cache out onto the underlying stream |
protected void | flushCacheWithAppend(byte[] bufferToAppend, int off, int len)
Writes the cache and bufferToAppend to the underlying stream
as one large chunk |
void | write(int b)
Write the specified byte to our output stream.
|
void | write(byte[] b)
Writes the array. |
void | write(byte[] src, int off, int len) |
protected void | writeClosingChunk() |
Parameters: stream to wrap bufferSize minimum chunk size (excluding last chunk)
Throws: IOException
Since: 3.0
Parameters: stream
Throws: IOException
Throws: IOException
Throws: IOException
Since: 3.0
Throws: IOException
Throws: IOException
Since: 3.0
Parameters: bufferToAppend off len
Throws: IOException
Since: 3.0
Parameters: b The byte to be written
Throws: IOException if an input/output error occurs
Parameters: b
Throws: IOException
Since: 3.0