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

Clarify java.io.Reader.read(char[], ...) behavior for full array

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      A DESCRIPTION OF THE PROBLEM :
      The documentation for the following java.io.Reader methods does not explain how the methods behave if an array of length 0, respectively length 0 is provided:
      - read(char[])
      - read(char[], int, int)

      It is not clear whether
      - 0 should be returned
      - -1 should be returned if at end of stream
      - An IOException should be thrown if reader is closed

      Compare this to the documentation of java.io.InputStream where this is clearly specified.
      It appears most of the JDK classes check if the reader is closed and afterwards return 0 in these cases.

      Related to JDK-8222329


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: