Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b01

      Backports

        Description

        Consider adding a blocking variant of readNBytes(int) that allocates
        the byte[] of up to "len" length internally and returns it. The method should be a suitable replacement for the internal sun.misc.IOUtils.readFully.

        sun.misc.IOUtils is a JDK internal convenience utility class that
        provides a single method that offers bulk blocking InputStream read
        semantics.

        There are a number of places, mainly in the security implementation,
        that required to read a specific number of bytes ( not to end of
        stream ), where it is preferable to not preallocate the byte[] and
        allow it to "grow" lazily, to be defensive against protocol errors.
        These cases cannot use read[N|All]Bytes.

        The discussion that lead to the filing of this issue can be found at:
        http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-October/035693.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bpb Brian Burkhalter
                  Reporter:
                  chegar Chris Hegarty
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: