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

Request for InputStream::readNBytes(int length)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      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.

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

              Created:
              Updated:
              Resolved: