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 OutputStream
b
- The byte to be writtenIOException
- if an input/output error occurspublic void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public 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.IOException
public void close() throws IOException
doneOutput
once before closing.close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
Copyright © 2012. All Rights Reserved.