java8-to-25: fix the Base64 replacement (sun.misc wraps with a bare newline) and add the wrapping probe

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6vDJ5fWY5uEZaJFNi
This commit is contained in:
Claude
2026-12-03 23:46:26 +05:30
parent 94f8a0e003
commit 9d05be0c2c
5 changed files with 44 additions and 2 deletions
@@ -0,0 +1,6 @@
$ java Wrap # JDK 8, encoding 100 zero bytes
sun.misc.BASE64Encoder length=137 chars 70..84: AAAAAA\nAAAAAA
Base64.getEncoder() length=136 chars 70..84: AAAAAAAAAAAAAA
Base64.getMimeEncoder() length=138 chars 70..84: AAAAAA\r\nAAAA
getMimeEncoder(76, \n) length=137 chars 70..84: AAAAAA\nAAAAAA
lengths 0..600: getMimeEncoder(76, \n) differs from sun.misc at: 57 114 171 228 285 342 399 456 513 570