public class BmcFileBackedOutputStream extends OutputStream
The temp file location is determined by the hadoop configuration property "hadoop.tmp.dir".
Constructor and Description |
---|
BmcFileBackedOutputStream(BmcPropertyAccessor propertyAccessor,
com.oracle.bmc.objectstorage.transfer.UploadManager uploadManager,
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 BmcFileBackedOutputStream(BmcPropertyAccessor propertyAccessor, com.oracle.bmc.objectstorage.transfer.UploadManager uploadManager, BiFunction<Long,InputStream,com.oracle.bmc.objectstorage.transfer.UploadManager.UploadRequest> requestBuilderFn)
protected OutputStream createOutputBufferStream() throws IOException
IOException
- if the operation could not be completed.protected InputStream getInputStreamFromBufferedStream()
createOutputBufferStream()
has been closed.protected long getInputStreamLengthInBytes()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
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.