Note that this class NEVER closes the underlying stream, even when close gets called. Instead, the stream will be marked as closed and no further output will be permitted.
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private int | |
| private boolean | closed
True if the stream is closed. |
| private final SessionOutputBuffer | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | ChunkedOutputStream(final SessionOutputBuffer
The session output buffer out, final int The minimum chunk size (excluding last chunk) bufferSize)
Deprecated
(4.3) use
Wraps a session output buffer and chunk-encodes the output.
ChunkedOutputStream#ChunkedOutputStream(int, SessionOutputBuffer)
|
| public | ChunkedOutputStream(final SessionOutputBuffer
the output buffer to wrap out)
Deprecated
(4.3) use
Wraps a session output buffer and chunks the output.
ChunkedOutputStream#ChunkedOutputStream(int, SessionOutputBuffer)
|
| public | ChunkedOutputStream(final int
The minimum chunk size (excluding last chunk) bufferSize, final SessionOutputBuffer The session output buffer out)Wraps a session output buffer and chunk-encodes the output. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public void | |
| public void | flush()
Overrides java. Implements java. |
| protected void | |
| protected void | flushCacheWithAppend(final byte[] bufferToAppend, final int off, final int len)
Writes the cache and bufferToAppend to the underlying stream as one large chunk |
| public void | write(final int
the b)byte.Implements abstract java. |
| public void | |
| public void | write(final byte[]
the data. src, final int the start offset in the data. off, final int the number of bytes to write. len)Overrides java. |
| protected void |
| cache | back to summary |
|---|---|
| private final byte[] cache | |
| cachePosition | back to summary |
|---|---|
| private int cachePosition | |
| closed | back to summary |
|---|---|
| private boolean closed True if the stream is closed. | |
| out | back to summary |
|---|---|
| private final SessionOutputBuffer out | |
| wroteLastChunk | back to summary |
|---|---|
| private boolean wroteLastChunk | |
| ChunkedOutputStream | back to summary |
|---|---|
| public ChunkedOutputStream(final SessionOutputBuffer out, final int bufferSize) throws IOException
Deprecated (4.3) use Wraps a session output buffer and chunk-encodes the output.
| |
| ChunkedOutputStream | back to summary |
|---|---|
| public ChunkedOutputStream(final SessionOutputBuffer out) throws IOException
Deprecated (4.3) use Wraps a session output buffer and chunks the output. The default buffer size of 2048 was chosen because the chunk overhead is less than 0.5%
| |
| ChunkedOutputStream | back to summary |
|---|---|
| public ChunkedOutputStream(final int bufferSize, final SessionOutputBuffer out) Wraps a session output buffer and chunk-encodes the output.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Finishes writing to the underlying stream, but does NOT close the underlying stream.
| |
| finish | back to summary |
|---|---|
| public void finish() throws IOException Must be called to ensure the internal cache is flushed and the closing chunk is written.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Flushes the content buffer and the underlying stream.
| |
| flushCache | back to summary |
|---|---|
| protected void flushCache() throws IOException Writes the cache out onto the underlying stream | |
| flushCacheWithAppend | back to summary |
|---|---|
| protected void flushCacheWithAppend(final byte[] bufferToAppend, final int off, final int len) throws IOException Writes the cache and bufferToAppend to the underlying stream as one large chunk | |
| write | back to summary |
|---|---|
| public void write(final int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b) throws IOException Overrides java. Writes the array. If the array does not fit within the buffer, it is not split, but rather written out as one large chunk.
| |
| write | back to summary |
|---|---|
| public void write(final byte[] src, final int off, final int len) throws IOException Overrides java. Writes the array. If the array does not fit within the buffer, it is not split, but rather written out as one large chunk.
| |
| writeClosingChunk | back to summary |
|---|---|
| protected void writeClosingChunk() throws IOException | |