Package org.apache.commons.io.output
Class ChunkedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.io.output.ChunkedOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
OutputStream which breaks larger output blocks into chunks. Native code may need to copy the input array; if the write buffer is very large this can cause
 OOME.
 
 To build an instance, see ChunkedOutputStream.Builder
 
- Since:
- 2.5
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class java.io.FilterOutputStreamout
- 
Constructor SummaryConstructorsConstructorDescriptionChunkedOutputStream(OutputStream stream) Deprecated.ChunkedOutputStream(OutputStream stream, int chunkSize) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ChunkedOutputStream.Builderbuilder()Constructs a newChunkedOutputStream.Builder.voidwrite(byte[] data, int srcOffset, int length) Writes the data buffer in chunks to the underlying streamMethods inherited from class java.io.FilterOutputStreamclose, flush, write, write
- 
Constructor Details- 
ChunkedOutputStreamDeprecated.Constructs a new stream that uses a chunk size ofIOUtils.DEFAULT_BUFFER_SIZE.- Parameters:
- stream- the stream to wrap
 
- 
ChunkedOutputStreamDeprecated.Constructs a new stream that uses the specified chunk size.- Parameters:
- stream- the stream to wrap
- chunkSize- the chunk size to use; must be a positive number.
- Throws:
- IllegalArgumentException- if the chunk size is <= 0
 
 
- 
- 
Method Details- 
builderConstructs a newChunkedOutputStream.Builder.- Returns:
- a new ChunkedOutputStream.Builder.
- Since:
- 2.13.0
 
- 
writeWrites the data buffer in chunks to the underlying stream- Overrides:
- writein class- FilterOutputStream
- Parameters:
- data- the data to write
- srcOffset- the offset
- length- the length of data to write
- Throws:
- IOException- if an I/O error occurs.
 
 
- 
builder(),ChunkedOutputStream.Builder, andChunkedOutputStream.Builder.get()