Index: components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java |
diff --git a/components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java b/components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java |
index 317bc32a808f9271cfc01c71356645a89b494a93..2bc694b731ffb4027291fc9631c657fce96cf62d 100644 |
--- a/components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java |
+++ b/components/cronet/android/api/src/org/chromium/net/UploadDataProviders.java |
@@ -20,6 +20,7 @@ public final class UploadDataProviders { |
* Uploads an entire file. |
* |
* @param file The file to upload |
+ * @return A new UploadDataProvider for the given file |
*/ |
public static UploadDataProvider create(final File file) { |
return new FileUploadProvider(new FileChannelProvider() { |
@@ -35,6 +36,7 @@ public final class UploadDataProviders { |
* |
* @param fd The file descriptor to upload |
* @throws IllegalArgumentException if {@code fd} is not a file. |
+ * @return A new UploadDataProvider for the given file descriptor |
*/ |
public static UploadDataProvider create(final ParcelFileDescriptor fd) { |
return new FileUploadProvider(new FileChannelProvider() { |
@@ -52,17 +54,29 @@ public final class UploadDataProviders { |
/** |
* Uploads a ByteBuffer, from the current {@code buffer.position()} to {@code buffer.limit()} |
+ * @param buffer The data to upload |
+ * @return A new UploadDataProvider for the given buffer |
*/ |
public static UploadDataProvider create(ByteBuffer buffer) { |
return new ByteBufferUploadProvider(buffer.slice()); |
} |
- /** Uploads {@code length} bytes from {@code data}, starting from {@code offset} */ |
+ /** |
+ * Uploads {@code length} bytes from {@code data}, starting from {@code offset} |
+ * @param data Array containing data to upload |
+ * @param offset Offset within data to start with |
+ * @param length Number of bytes to upload |
+ * @return A new UploadDataProvider for the given data |
+ */ |
public static UploadDataProvider create(byte[] data, int offset, int length) { |
return new ByteBufferUploadProvider(ByteBuffer.wrap(data, offset, length)); |
} |
- /** Uploads the contents of {@code data} */ |
+ /** |
+ * Uploads the contents of {@code data} |
+ * @param data Array containing data to upload |
+ * @return A new UploadDataProvider for the given data |
+ */ |
public static UploadDataProvider create(byte[] data) { |
return create(data, 0, data.length); |
} |