Class ChunkedOutputStream

    • Constructor Detail

      • ChunkedOutputStream

        public ChunkedOutputStream​(OutputStream stream,
                                   int bufferSize)
                            throws IOException
        Deprecated.
        Wraps a stream and chunks the output.
        Parameters:
        stream - to wrap
        bufferSize - minimum chunk size (excluding last chunk)
        Throws:
        IOException
        Since:
        3.0
      • ChunkedOutputStream

        public ChunkedOutputStream​(OutputStream stream)
                            throws IOException
        Deprecated.
        Wraps a stream and chunks the output. The default buffer size of 2048 was chosen because the chunk overhead is less than 0.5%
        Parameters:
        stream -
        Throws:
        IOException
    • Method Detail

      • finish

        public void finish()
                    throws IOException
        Deprecated.
        Must be called to ensure the internal cache is flushed and the closing chunk is written.
        Throws:
        IOException
        Since:
        3.0
      • write

        public void write​(int b)
                   throws IOException
        Deprecated.
        Write the specified byte to our output stream. Note: Avoid this method as it will cause an inefficient single byte chunk. Use write (byte[], int, int) instead.
        Specified by:
        write in class OutputStream
        Parameters:
        b - The byte to be written
        Throws:
        IOException - if an input/output error occurs
      • write

        public void write​(byte[] b)
                   throws IOException
        Deprecated.
        Writes the array. If the array does not fit within the buffer, it is not split, but rather written out as one large chunk.
        Overrides:
        write in class OutputStream
        Parameters:
        b -
        Throws:
        IOException
        Since:
        3.0