public class BmcInMemoryOutputStream extends OutputStream
Constructor and Description |
---|
BmcInMemoryOutputStream(com.oracle.bmc.objectstorage.transfer.UploadManager uploadManager,
int bufferSizeInBytes,
BiFunction<Long,InputStream,com.oracle.bmc.objectstorage.transfer.UploadManager.UploadRequest> requestBuilderFn) |
Modifier and Type | Method and Description |
---|---|
void |
close()
On close, this class will attempt to submit a PUT request to Object Store using the data that has been
accumulated in the buffer.
|
protected OutputStream |
createOutputBufferStream()
Creates the output stream that should be used to buffer all bytes to.
|
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 BmcInMemoryOutputStream(com.oracle.bmc.objectstorage.transfer.UploadManager uploadManager, int bufferSizeInBytes, BiFunction<Long,InputStream,com.oracle.bmc.objectstorage.transfer.UploadManager.UploadRequest> requestBuilderFn)
protected OutputStream createOutputBufferStream()
protected long getInputStreamLengthInBytes() throws IOException
IOException
- if the length could not be determined.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
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
Copyright © 2016–2023. All rights reserved.