|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.apache.http.impl.io.ChunkedOutputStream
public class ChunkedOutputStream
Implements chunked transfer coding. See RFC 2616, section 3.6.1. Writes are buffered to an internal buffer (2048 default size).
| Constructor Summary | |
|---|---|
ChunkedOutputStream(SessionOutputBuffer out)
Wraps a session output buffer and chunks the output. |
|
ChunkedOutputStream(SessionOutputBuffer out,
int bufferSize)
Wraps a session output buffer 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 content buffer and the underlying stream. |
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(byte[] b)
Writes the array. |
void |
write(byte[] src,
int off,
int len)
Writes count bytes from the byte array
buffer starting at offset to this
OutputStream. |
void |
write(int b)
Writes the specified byte oneByte to this OutputStream. |
protected void |
writeClosingChunk()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChunkedOutputStream(SessionOutputBuffer out,
int bufferSize)
throws IOException
out - the session output buffer to wrapbufferSize - minimum chunk size (excluding last chunk)
IOException
public ChunkedOutputStream(SessionOutputBuffer out)
throws IOException
out - the output buffer to wrap
IOException| Method Detail |
|---|
protected void flushCache()
throws IOException
IOException
protected void flushCacheWithAppend(byte[] bufferToAppend,
int off,
int len)
throws IOException
bufferToAppend - off - len -
IOException
protected void writeClosingChunk()
throws IOException
IOException
public void finish()
throws IOException
IOException
public void write(int b)
throws IOException
OutputStreamoneByte to this OutputStream.
Only the low order byte of oneByte is written.
write in class OutputStreamb - the byte to be written
IOException - If an error occurs attempting to write to this OutputStream.
public void write(byte[] b)
throws IOException
write in class OutputStreamb -
IOException
public void write(byte[] src,
int off,
int len)
throws IOException
OutputStreamcount bytes from the byte array
buffer starting at offset to this
OutputStream.
write in class OutputStreamsrc - the buffer to be writtenoff - offset in buffer to get byteslen - number of bytes in buffer to write
IOException - If an error occurs attempting to write to this OutputStream.
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOException
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||