@NotThreadSafe public class ChunkedOutputStream extends java.io.OutputStream
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.
| 构造器和说明 |
|---|
ChunkedOutputStream(int bufferSize,
SessionOutputBuffer out)
Wraps a session output buffer and chunk-encodes the output.
|
ChunkedOutputStream(SessionOutputBuffer out)
已过时。
|
ChunkedOutputStream(SessionOutputBuffer out,
int bufferSize)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 the array.
|
void |
write(int b) |
protected void |
writeClosingChunk() |
@Deprecated public ChunkedOutputStream(SessionOutputBuffer out, int bufferSize) throws java.io.IOException
ChunkedOutputStream(int, SessionOutputBuffer)out - The session output bufferbufferSize - The minimum chunk size (excluding last chunk)java.io.IOException - not thrown@Deprecated public ChunkedOutputStream(SessionOutputBuffer out) throws java.io.IOException
ChunkedOutputStream(int, SessionOutputBuffer)out - the output buffer to wrapjava.io.IOException - not thrownpublic ChunkedOutputStream(int bufferSize,
SessionOutputBuffer out)
bufferSize - The minimum chunk size (excluding last chunk)out - The session output bufferprotected void flushCache()
throws java.io.IOException
java.io.IOExceptionprotected void flushCacheWithAppend(byte[] bufferToAppend,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionprotected void writeClosingChunk()
throws java.io.IOException
java.io.IOExceptionpublic void finish()
throws java.io.IOException
java.io.IOException - in case of an I/O errorpublic void write(int b)
throws java.io.IOException
write 在类中 java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write 在类中 java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] src,
int off,
int len)
throws java.io.IOException
write 在类中 java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush 在接口中 java.io.Flushableflush 在类中 java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在类中 java.io.OutputStreamjava.io.IOException