[Base64] Codereview request for 8006315 8006530

Xueming Shen xueming.shen at oracle.com
Fri Feb 1 07:37:59 UTC 2013


This is the webrev for

8006530: Base64.getMimeDecoder().decode() throws exception for 
non-base64 character after adding =
8006315: Base64.Decoder decoding methods are not consistent in treating 
non-padded data


The change is to

(1) explicitly specify line feed is not added to the end of mime encoded 
output (no surprise)

(2) mime decoder now ignores any non-base64 character after padding = 
(same as it
ignores those non-base64 character within the data (mime base64 spec). 
for use case like a padding \n at the end of any input data from the 
file and, as suggested
from real base64 use case.

(3) explicitly specify padding character at the end of the base64 
encoded data is
optional when DECODING (encoder always adds padding character = when 
The "decoding" part of the RFC really does not make it a MUST, so be 

(4) update the decoder inputstream to behave the same way other decoders 
do, to
accept AA and AAA same as AA== AAA=.

Please help review.


More information about the core-libs-dev mailing list