public static final class S3ADataBlocks.BlockUploadData extends Object implements Closeable
The data is accessed via the content provider; other constructors create the appropriate content provider for the data.
When close() is called, the content provider is itself closed.
| Constructor and Description |
|---|
BlockUploadData(byte[] bytes,
int offset,
int size,
Supplier<Boolean> isOpen)
Byte array constructor, with support for
uploading just a slice of the array.
|
BlockUploadData(byte[] bytes,
Supplier<Boolean> isOpen)
Byte array constructor to upload all of the array.
|
BlockUploadData(File file,
Supplier<Boolean> isOpen)
File constructor; input stream will be null.
|
BlockUploadData(UploadContentProviders.BaseContentProvider<?> contentProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close: closes any upload stream provided in the constructor.
|
UploadContentProviders.BaseContentProvider<?> |
getContentProvider()
The content provider.
|
public BlockUploadData(UploadContentProviders.BaseContentProvider<?> contentProvider)
public BlockUploadData(File file, Supplier<Boolean> isOpen)
file - file to uploadisOpen - optional predicate to check if the stream is open.public BlockUploadData(byte[] bytes,
int offset,
int size,
Supplier<Boolean> isOpen)
bytes - buffer to read.offset - offset in buffer.size - size of the data.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.public BlockUploadData(byte[] bytes,
Supplier<Boolean> isOpen)
bytes - buffer to read.isOpen - optional predicate to check if the stream is open.IllegalArgumentException - if the arguments are invalid.NullPointerException - if the buffer is null.public UploadContentProviders.BaseContentProvider<?> getContentProvider()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - inherited exceptionCopyright © 2008–2024 Apache Software Foundation. All rights reserved.