? ChunkedOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.io.output.ChunkedOutputStream
????????:
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.
???????:
2.5
  • ???????

    • ChunkedOutputStream

      public ChunkedOutputStream(OutputStream stream, int chunkSize)
      Creates a new stream that uses the specified chunk size.
      ??:
      stream - the stream to wrap
      chunkSize - the chunk size to use; must be a positive number.
      ??:
      IllegalArgumentException - if the chunk size is <= 0
    • ChunkedOutputStream

      Creates a new stream that uses a chunk size of DEFAULT_CHUNK_SIZE.
      ??:
      stream - the stream to wrap
  • ??????

    • write

      public void write(byte[] data, int srcOffset, int length) throws IOException
      Writes the data buffer in chunks to the underlying stream
      ??:
      write ??? FilterOutputStream
      ??:
      data - the data to write
      srcOffset - the offset
      length - the length of data to write
      ??:
      IOException - if an I/O error occurs.