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

Request for InputStream::readNBytes(int length)

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      We now have InputStreaam::readNBytes(byte[] b, int off, int len) but it will be nice to have an overloaded version that does not need a pre-allocated array (like readAllBytes()). This will be especially useful when the length is from an untrusted source and allocating an arbitrary size of array would exhaust memory or just throw an OOME.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              weijun Weijun Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: