As discussed on the mailing list https://mail.openjdk.org/pipermail/classfile-api-dev/2023-June/000381.html, BufWriter::asByteBuffer has a behavior not suitable for API and is only used by internal StackMapGenerator/StackCounter, so it will be converted to an internal API.
Somehow the ByteBuffer needs to be sliced, or StackMapGenerator encounters IOOBE. Not sure what the exact cause was. ------------- Commit messages: - Convert asByteBuffer to an internal API Changes: https://git.openjdk.org/jdk/pull/14736/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14736&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8311175 Stats: 9 lines in 4 files changed: 0 ins; 6 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/14736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/14736/head:pull/14736 PR: https://git.openjdk.org/jdk/pull/14736