Write to OutputStream in azureblobsdk

stageBlock requires an InputStream that supports marks which the
socket does not support and wrapping in a BufferedInputStream would
require extra memory.  Fixes #708.
pull/702/head
Andrew Gaul 2024-10-26 15:49:54 -07:00
rodzic 6185f2b46f
commit 6939e6f525
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -365,8 +365,9 @@ public final class AzureBlobStore extends BaseBlobStore {
.getBlockBlobClient();
var blockId = makeBlockId(partNumber);
var length = payload.getContentMetadata().getContentLength();
try (var is = payload.openStream()) {
client.stageBlock(blockId, is, length);
try (var is = payload.openStream();
var os = client.getBlobOutputStream()) {
is.transferTo(os);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}