public class MultiPartOutputStream extends OutputStream
OutputStream which packages data written to it into discrete StreamParts which can be obtained
in a separate thread via iteration and uploaded to S3.
A single MultiPartOutputStream is allocated a range of part numbers it can assign to the StreamParts
it produces, which is determined at construction.
It's essential to call
close() when finished so that it can create the final StreamPart and consumers
can finish.
Writing to the stream may lead to trying to place a completed part on a queue,
which will block if the queue is full and may lead to an InterruptedException.
| Modifier and Type | Field and Description |
|---|---|
static int |
S3_MIN_PART_SIZE |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Packages any remaining data into a
StreamPart and signals to the StreamTransferManager that there are no more parts
afterwards. |
String |
toString() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flushpublic static final int S3_MIN_PART_SIZE
public void write(int b)
write in class OutputStreampublic void write(byte[] b,
int off,
int len)
write in class OutputStreampublic void write(byte[] b)
write in class OutputStreampublic void close()
StreamPart and signals to the StreamTransferManager that there are no more parts
afterwards. You cannot write to the stream after it has been closed.close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamCopyright © 2020. All rights reserved.