Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6852033 Inputs/Outputs methods to make common I/O tasks easy to do
  3. JDK-8185575

new method InputStream.readAllBytes(int n) to read up to n bytes

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Duplicate
    • P4
    • tbd
    • None
    • core-libs

    Description

      A method is needed to read up to a specific number of bytes from a stream that handles the allocation of the array similar to readAllBytes().

      Reading up to nbytes can guard against excessive unexpected input while not requiring an array allocation for the full size.

      The implementation of InputStream.readAllBytes() already has the functionality but does not limit the input size.

      A similar function already exists in sun/security/util/IOUtils.java but is not public.

      Attachments

        Issue Links

          Activity

            People

              bpb Brian Burkhalter
              rriggs Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: