Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

UploadDataProviders

public final class UploadDataProviders extends Object

Provides implementations of UploadDataProvider for common use cases.

Public Method Summary

static UploadDataProvider
create(File file)
Uploads an entire file.
static UploadDataProvider
create(ParcelFileDescriptor fd)
Uploads an entire file, closing the descriptor when it is no longer needed.
static UploadDataProvider
create(byte[] data, int offset, int length)
Uploads length bytes from data, starting from offset

Inherited Method Summary

Public Methods

public static UploadDataProvider create (File file)

Uploads an entire file.

Parameters
file The file to upload
Returns
  • A new UploadDataProvider for the given file

public static UploadDataProvider create (ParcelFileDescriptor fd)

Uploads an entire file, closing the descriptor when it is no longer needed.

Parameters
fd The file descriptor to upload
Returns
  • A new UploadDataProvider for the given file descriptor
Throws
IllegalArgumentException if fd is not a file.

public static UploadDataProvider create (byte[] data, int offset, int length)

Uploads length bytes from data, starting from offset

Parameters
data Array containing data to upload
offset Offset within data to start with
length Number of bytes to upload
Returns
  • A new UploadDataProvider for the given data