public class ChunkedOutputStream extends OutputStream
OutputStream wrapper that supports the chunked transfer encoding.ChunkedInputStream| Constructor and Description |
|---|
ChunkedOutputStream(OutputStream stream)
Constructs an output stream wrapping the given stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this output stream, calling
doneOutput once before closing. |
void |
doneOutput()
This method differs from
close as it merely writes the
final chunk and does not close the underlying output stream. |
void |
flush()
Flushes this output stream.
|
String |
toString() |
void |
write(byte[] b)
Writes the specified byte array.
|
void |
write(byte[] b,
int off,
int len)
Writes the specified byte array.
|
void |
write(int b)
Writes the specified byte to the output stream.
|
public ChunkedOutputStream(OutputStream stream)
stream - wrapped output stream. Must be non-null.public void write(int b)
throws IOException
write in class OutputStreamb - The byte to be writtenIOException - if an input/output error occurspublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void doneOutput()
throws IOException
close as it merely writes the
final chunk and does not close the underlying output stream.
This has no effect if this method was called already.IOExceptionpublic void close()
throws IOException
doneOutput once before closing.close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2012. All Rights Reserved.