Review/comment needed for the new public java.util.Base64 class

Ulf Zibis Ulf.Zibis at
Tue Oct 23 14:57:34 UTC 2012

Am 23.10.2012 15:04, schrieb Alan Bateman:
> I'm not sure that getUrlEncoder is the most suitable name to get a base64url encoder. The reason 
> is that the method name makes it sound like it returns a URLEncoder or or at least an encoder for 
> HTML forms. While more verbose, getBase64UrlEncoder is clear that it returns a base64url encoder.

I'm wondering, why there are those get... methods at all.

Alternatively you could make the appropriate constructors and predifined static variants public. So 
one only should use:
Base64.Encoder encoder = new Base64.Encoder(...);
Base64.Encoder urlEncoder = Base64.Encoder.RFC4648_URLSAFE;

No need for those looong method names.


More information about the core-libs-dev mailing list