Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8279283 BufferedInputStream should override transferTo
  3. JDK-8294696

BufferedInputStream.transferTo should drain buffer when mark set

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P4
    • 20
    • None
    • core-libs
    • b23

    Description

      JDK-8279283 excluded two cases from its target optimization: a mark being set, and buffer holding unwritten bytes. This PR resolves the latter one: In case the buffer is holding unwritten bytes, the buffer is first drained into the target stream, before the optimization is called. By doing so, the propability that the optimization actually takes effect is strongly increased, as typically BufferedInputStream will actually hold unwritten bytes in the buffer in most cases. Due to that, this new issue is the actual enabler for the benefit originally proposed by JDK-8279283.

      Attachments

        Issue Links

          Activity

            People

              mkarg Markus Karg
              mkarg Markus Karg
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: