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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 17
    • 7
    • 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.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: