Base64.Encoder.wrap(os).write(byte[],int,int) with incorrect arguments should not produce output

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b135

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

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

        This behavior looks inconsistent.

              Assignee:
              Ivan Gerasimov
              Reporter:
              Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: