ByteArrayInputStream#read with a byte array of length 0 not consistent with InputStream when at EOF

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 17
    • Affects Version/s: 7
    • Component/s: core-libs
    • None
    • b31
    • generic, x86
    • generic, windows_7

        When InputStream#read is invoked with a byte[] of length 0 then 0 is returned without attempting to read any bytes. ByteArrayInputStream breaks this contract for the case that all bytes have been read. In that case it returns -1 instead of 0.

              Assignee:
              Brian Burkhalter
              Reporter:
              Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: