public class BmcMultipartOutputStream extends OutputStream
Constructor and Description |
---|
BmcMultipartOutputStream(BmcPropertyAccessor propertyAccessor,
MultipartUploadRequest request,
int bufferSizeInBytes,
ExecutorService parallelMd5executor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
On close, this class will attempt to commit a multipart upload to Object Store using the data written to this
output stream so far.
|
protected OutputStream |
createOutputBufferStream()
This method delays initialization of resources included any thread pools used by the multipart upload API.
|
void |
flush() |
protected InputStream |
getInputStreamFromBufferedStream()
Creates an input stream that will be used to fetch the data to send to Object Store.
|
protected long |
getInputStreamLengthInBytes()
Fetches the length of the input stream that needs to be sent.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
write
public BmcMultipartOutputStream(BmcPropertyAccessor propertyAccessor, MultipartUploadRequest request, int bufferSizeInBytes, ExecutorService parallelMd5executor)
public void close() throws IOException
On close, this class will attempt to submit a PUT request to Object Store using the data that has been accumulated in the buffer. If the PUT fails, an IOException will be raised.
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected OutputStream createOutputBufferStream()
protected long getInputStreamLengthInBytes()
protected InputStream getInputStreamFromBufferedStream()
createOutputBufferStream()
has been closed.public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
Copyright © 2016–2023. All rights reserved.