public class ChunkedOutputStream extends OutputStream
| Constructor and Description |
|---|
ChunkedOutputStream(OutputStream outputStream)
Create a new instance of ChunkedOutputStream by wrapping around OutputStream
The underlying output stream will be left open if we call close() on this instance
|
ChunkedOutputStream(OutputStream outputStream,
boolean leaveUnderlyingStreamOpen)
Create a new instance of ChunkedOutputStream by wrapping around OutputStream
|
ChunkedOutputStream(OutputStream outputStream,
int chunkSize)
Create a new instance of ChunkedOutputStream by wrapping around OutputStream
The underlying output stream will be left open if we call close() on this instance
|
ChunkedOutputStream(OutputStream outputStream,
int chunkSize,
boolean leaveUnderlyingStreamOpen)
Create a new instance of ChunkedOutputStream by wrapping around OutputStream
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This finishes write by writing last chunk and then, if the instance was created with parameter
leaveUnderlyingStreamOpen set to false, closes the underlying stream, otherwise it flushes it and leave opened
|
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
writepublic ChunkedOutputStream(OutputStream outputStream)
outputStream - - stream to wrappublic ChunkedOutputStream(OutputStream outputStream, int chunkSize)
outputStream - - stream to wrapchunkSize - - size of a chunkpublic ChunkedOutputStream(OutputStream outputStream, boolean leaveUnderlyingStreamOpen)
outputStream - - stream to wrapleaveUnderlyingStreamOpen - - if true when close() is called the outputStream is flushed, but not closedpublic ChunkedOutputStream(OutputStream outputStream, int chunkSize, boolean leaveUnderlyingStreamOpen)
outputStream - - stream to wrapchunkSize - - size of a chunkleaveUnderlyingStreamOpen - - if true when close() is called the outputStream is flushed, but not closedpublic void write(int 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 close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2019. All rights reserved.