public class ChunkedOutputStream extends OutputStream
| Constructor and Description |
|---|
ChunkedOutputStream(OutputStream stream)
Wraps a stream and chunks the output.
|
ChunkedOutputStream(OutputStream stream,
int bufferSize)
Wraps a stream and chunks the output.
|
| Modifier and Type | Method and Description |
|---|---|
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 underlying stream, but leaves the internal buffer alone.
|
void |
write(byte[] b)
Writes the array.
|
void |
write(byte[] src,
int off,
int len) |
void |
write(int b)
Write the specified byte to our output stream.
|
public ChunkedOutputStream(OutputStream stream, int bufferSize) throws IOException
stream - to wrapbufferSize - minimum chunk size (excluding last chunk)IOExceptionpublic ChunkedOutputStream(OutputStream stream) throws IOException
stream - IOExceptionpublic void finish()
throws IOException
IOExceptionpublic 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 OutputStreamb - IOExceptionpublic void write(byte[] src,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved