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

Add a BodyPublishers.ofFileChannel method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 11
    • core-libs
    • None

      For multi-part uploads to cloud storage (S3, OCI etc) it is convenient to open a FileChannel to the source file and then PUT/POST different portions of the file in parallel HTTP requests.

      This would be simplified by a:

      BodyPublishers.ofFileChannel(FileChannel chan, long position, long size)

      method which sends size bytes from the channel at the given position. The size of an individual part in the upload may be quite large, so reading the entire part into a byte array could be too expensive in memory.

            jpai Jaikiran Pai
            revans Richard Evans
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: