org.apache.commons.io.output

Class ChunkedOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable


    public class ChunkedOutputStreamextends FilterOutputStream
    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.
    Since:
    2.5
    • Constructor Detail

      • ChunkedOutputStream

        public ChunkedOutputStream(OutputStream stream,                   int chunkSize)
        Creates 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
      • ChunkedOutputStream

        public ChunkedOutputStream(OutputStream stream)
        Creates a new stream that uses a chunk size of DEFAULT_CHUNK_SIZE.
        Parameters:
        stream - the stream to wrap
    • Method Detail

      • write

        public void write(byte[] data,         int srcOffset,         int length)           throws IOException
        Writes the data buffer in chunks to the underlying stream
        Overrides:
        write in 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.

Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14