Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8329829 HttpClient: Add a BodyPublishers.ofFileChannel method
  3. JDK-8365855

Release Note: New ofFileChannel Method in java.net.http.HttpRequest.BodyPublishers to Upload Region of a File

XMLWordPrintable

      A new static `ofFileChannel(FileChannel channel, long offset, long length)` method has been added to `java.net.HttpRequest.BodyPublishers`. This method provides an `HttpClient` request body publisher to upload a certain region of a file. The new publisher does not modify the state of the passed `FileChannel`, streams the file channel bytes as it publishes (i.e., avoids reading the entire file into the memory), and can be leveraged to implement sliced uploads.

            vyazici Volkan Yazici
            vyazici Volkan Yazici
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: