RFR: 8026330: java.util.Base64 urlEncoder should omit padding

Xueming Shen xueming.shen at oracle.com
Wed Nov 6 18:44:06 UTC 2013


Hi,

The latest spec and implementation of java.util.Base64.getXXXEncoder()
is to add appropriate padding character(s) at the end of the output
encoded data stream, to follow the note explicitly specified in the
RFC

    Implementations MUST include appropriate pad characters at the end
    of encoded data unless the specification referring to this document
    explicitly states otherwise.

However the RFE also mentions that

    In some circumstances, the use of padding ("=") in base-encoded data
    is not required or used...

Feedback so far also suggests that Base64.encoder without padding might
be desired in some real world use scenario.

So here is the webrev to add a new method to the Encoder class to return
a non-padding version.

http://cr.openjdk.java.net/~sherman/8026330/webrev

Thanks!
-Sherman



More information about the core-libs-dev mailing list