Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
It should be possible to write (almost) Integer.MAX_VALUE bytes to a ByteArrayOutputStream. In fact, because of resizing algorithm, the effective capacity is only half that. ByteArrayOutputStream should use the same resizing computation for huge capacities as is already done in collection classes like ArrayList. Fix is easy. http://cr.openjdk.java.net/~martin/webrevs/openjdk9/ByteArrayOutputStream-MAX_ARRAY_SIZE/
|