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.
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.
- relates to
-
JDK-8235761 HttpClient: Investigate support for multipart/form-data in BodyPublishers
- Open