public final class**UploadDataProviders** extends Object  
Provides implementations of[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)for common use cases.  

### Public Method Summary

|------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html) | [create](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/UploadDataProviders.html#create(java.io.File))(File file) Uploads an entire file.                                                                                      |
| static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html) | [create](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/UploadDataProviders.html#create(byte[]))(byte\[\] data) Uploads the contents of`data`                                                                                  |
| static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html) | [create](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/UploadDataProviders.html#create(java.nio.ByteBuffer))(ByteBuffer buffer) Uploads a ByteBuffer, from the current`buffer.position()`to`buffer.limit()`                   |
| static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html) | [create](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/UploadDataProviders.html#create(byte[],%20int,%20int))(byte\[\] data, int offset, int length) Uploads`length`bytes from`data`, starting from`offset`                   |
| static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html) | [create](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/UploadDataProviders.html#create(android.os.ParcelFileDescriptor))(ParcelFileDescriptor fd) Uploads an entire file, closing the descriptor when it is no longer needed. |

### Inherited Method Summary

From class java.lang.Object  

|------------------|---------------------------|
| Object           | clone()                   |
| boolean          | equals(Object arg0)       |
| void             | finalize()                |
| final Class\<?\> | getClass()                |
| int              | hashCode()                |
| final void       | notify()                  |
| final void       | notifyAll()               |
| String           | toString()                |
| final void       | wait(long arg0, int arg1) |
| final void       | wait(long arg0)           |
| final void       | wait()                    |

## Public Methods

#### public static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)**create**(File file)

Uploads an entire file.  

##### Parameters

| file | The file to upload |
|------|--------------------|

##### Returns

- A new UploadDataProvider for the given file  

#### public static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)**create**(byte\[\] data)

Uploads the contents of`data`  

##### Parameters

| data | Array containing data to upload |
|------|---------------------------------|

##### Returns

- A new UploadDataProvider for the given data  

#### public static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)**create**(ByteBuffer buffer)

Uploads a ByteBuffer, from the current`buffer.position()`to`buffer.limit()`  

##### Parameters

| buffer | The data to upload |
|--------|--------------------|

##### Returns

- A new UploadDataProvider for the given buffer  

#### public static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)**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  

#### public static[UploadDataProvider](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UploadDataProvider.html)**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. |
|--------------------------|----------------------|