On Mon, 12 Jan 2026 22:13:06 GMT, Daniel Gredler <[email protected]> wrote:
> ByteArrayOutputStream.ensureCapacity(int) is currently private. It would be > useful if it were protected, so that it can be more easily extended by > subclasses. > > Mailing list discussion: > https://mail.openjdk.org/pipermail/core-libs-dev/2026-January/156983.html Subclasses have access to the protected buf/count fields so it's not clear that there is a strong case for adding this. I think it would be useful to hear more on how this might be used. BAOS is more of an implementation class, is extending it the right thing for the examples that you have in mind? Is the issue more about trying to size a byte[] that is close to the MAX_VALUE limit? What is the reason that the existing methods are not re-specified to use it? ------------- PR Comment: https://git.openjdk.org/jdk/pull/29180#issuecomment-3742748336
