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

Ensure that HttpResponse.BodySubscribers.ofFile writes all bytes

XMLWordPrintable

    • b03
    • Verified

        The implementation of PathSubscriber should ensure that all bytes from the given buffers are written. Specifically, this method in PathSubscriber:

        @Override
        public void onNext(List<ByteBuffer> items) {
            try {
                out.write(items.toArray(Utils.EMPTY_BB_ARRAY));
        ...

        the implementation assumes out.write(ByteBuffer[]) always writes the content of all buffers - this isn't the case and the method can write a lesser number of bytes from input buffers.

        See https://mail.openjdk.org/pipermail/net-dev/2022-December/019883.html

              chegar Chris Hegarty
              chegar Chris Hegarty
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: