• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 9
    • core-libs
    • b01

        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

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

                Created:
                Updated:
                Resolved: