Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6766844

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 7
    • 17
    • core-libs
    • None
    • b31
    • generic, x86
    • generic, windows_7

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

                bpb Brian Burkhalter
                alanb Alan Bateman
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: