On 31/01/2013 22:15, Xueming Shen wrote:
Hi,

Obviously ioe is not an appropriate exception for invalid base64 bytes,
and it's inconsistent with the rest of decode methods, as the submitter
suggested.
The change is to explicitly specify (as other decoding methods do) that
IAE will be thrown if the input stream contains invalid base64 bytes. The
impl is also updated according.

Please help review.

http://cr.openjdk.java.net/~sherman/8006295/webrev/
I don't think IAE is right here as the problem is not with the argument passed to the InputStream read method. The simplest thing is probably to just make it clear in the wrap's javadoc that the reading from the InputStream will throw IOException if bytes, that are not in a valid base64 scheme, are encountered. This would be consistent with say, reading from a BufferedReader where malformed or unmappable characters are encountered (assuming it is created with a charset decoder that is configured to report errors of course).

-Alan

Reply via email to