On 01/09/2016 17:40, Ivan Gerasimov wrote:

Hello!

An encoding output stream 'es' can be obtained as encoder.wrap(os).
Normally, es.write(buf, off, len) throws IndexOutOfBoundException, if the referenced portion lies outside of the buffer.
In this case, nothing is written to the underlying output stream 'os'.

However, if (off + len) overflows, then the call to write() will produce some output, and only when it reaches the boundary of the buf will it throw the exception.

This behavior looks inconsistent.

Would you please help review the simple fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8165243
WEBREV: http://cr.openjdk.java.net/~igerasim/8165243/00/webrev/
TestBase64 is the unit test for this API, should the test be added to that instead?

-Alan

Reply via email to