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:
@@ -3,8 +3,8 @@ package com.ankurm.fixed;
|
||||
import java.util.Base64;
|
||||
|
||||
public final class Tokens {
|
||||
/** getMimeEncoder() wraps at 76 characters like sun.misc did; getEncoder() does not wrap. */
|
||||
/** sun.misc wrapped lines at 76 characters with a bare '\n'; see probes/base64/Wrap.java. */
|
||||
public static String encode(byte[] raw) {
|
||||
return Base64.getMimeEncoder().encodeToString(raw);
|
||||
return Base64.getMimeEncoder(76, new byte[] {'\n'}).encodeToString(raw);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user