|
||||||||||
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)
|
void |
write(int b)
|
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 java.io.IOException
out
- the session output buffer to wrapbufferSize
- minimum chunk size (excluding last chunk)
java.io.IOException
public ChunkedOutputStream(SessionOutputBuffer out) throws java.io.IOException
out
- the output buffer to wrap
java.io.IOException
Method Detail |
---|
protected void flushCache() throws java.io.IOException
java.io.IOException
protected void flushCacheWithAppend(byte[] bufferToAppend, int off, int len) throws java.io.IOException
bufferToAppend
- off
- len
-
java.io.IOException
protected void writeClosingChunk() throws java.io.IOException
java.io.IOException
public void finish() throws java.io.IOException
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
b
-
java.io.IOException
public void write(byte[] src, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |