[Base64] Codereview request for 8006315 8006530 AND 8006295
Alan Bateman
Alan.Bateman at oracle.com
Mon Feb 4 14:20:15 UTC 2013
On 01/02/2013 16:55, Xueming Shen wrote:
> Hi,
>
> For 8006295 it appears the more reasonable approach is to continue
> throw IOE
> but document this behavior clearly at the wrap(is) API. So the change
> is joined
> with these two.
>
> 8006295: Base64.Decoder.wrap(java.io.InputStream) returns InputStream
> which throws unspecified IOException on attempt to decode invalid
> Base64 byte stream
>
> http://cr.openjdk.java.net/~sherman/8006295_8006315_8006530/webrev/
>
> Thanks!
> -Sherman
In Decoder's javadoc then I would suggest "as if followed by padding
characters(s)" rather than "as if there are padding charcacter(s) followed".
In wrap's javadoc it currently reads:
"If the input byte stream is not in valid Base64 encoding scheme then
IOException will be thrown when reading any invalid Base64 byte(s) from
the returned input stream."
I guess this okay but an alternative would be:
"The {@code InputStream} methods that reads from the stream throw {@code
IOException} if bytes are read that cannot be decoded".
Otherwise this looks okay to me and good to have additional test coverage.
-Alan.
More information about the core-libs-dev
mailing list