Skip to content

Instantly share code, notes, and snippets.

View jcputney's full-sized avatar

Jonathan Putney jcputney

View GitHub Profile
@jcputney
jcputney / S3OutputStream.java
Last active September 12, 2024 15:59 — forked from blagerweij/S3OutputStream.java
OutputStream which wraps AWS Java SDK v2 S3Client, with support for streaming large files directly to S3
import java.io.ByteArrayInputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest;
import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest;
import software.amazon.awssdk.services.s3.model.CompletedMultipartUpload;