FastByteArrayOutputStream has a write function which has addBuffer which accepts minCapacity in integer and allocates next block size as next power of 2 of minCapacity. So, block size keeps increasing in order to accomodate the file in buffer.
I have a file greater than max size, (Internally diving it to 3 files, pushing them to outputstream an finally creating it a file in azure storage) so while writing it to buffer the minCapacity goes over max integer value of 2147483647 and starts assigning block size in signed integer -2147483648, which is invalid and gives exception as in the image attached.