Stay organized with collections
Save and categorize content based on your preferences.
UploadDataSink
abstract class UploadDataSink
Defines callbacks methods for UploadDataProvider
. All methods may be called synchronously or asynchronously, on any thread.
Summary
Public constructors
UploadDataSink
UploadDataSink()
Public methods
onReadError
abstract fun onReadError(exception: Exception): Unit
Called by UploadDataProvider
when a read fails.
Parameters |
exception |
Exception: Exception passed on to the embedder. This value cannot be null . |
onReadSucceeded
abstract fun onReadSucceeded(finalChunk: Boolean): Unit
Called by UploadDataProvider
when a read succeeds.
Parameters |
finalChunk |
Boolean: For chunked uploads, true if this is the final read. It must be false for non-chunked uploads. |
onRewindError
abstract fun onRewindError(exception: Exception): Unit
Called by UploadDataProvider
when a rewind fails, or if rewinding uploads is not supported.
Parameters |
exception |
Exception: Exception passed on to the embedder. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# UploadDataSink\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions)\n\nUploadDataSink\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/http/UploadDataSink \"View this page in Java\") \n\n```\nabstract class UploadDataSink\n```\n\n|---|--------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.http.UploadDataSink](#) |\n\nDefines callbacks methods for [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider). All methods may be called synchronously or asynchronously, on any thread.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------|---|\n| [UploadDataSink](#UploadDataSink())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onReadError](#onReadError(java.lang.Exception))`(`exception:` `[Exception](../../../java/lang/Exception.html#)`)` Called by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a read fails. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onReadSucceeded](#onReadSucceeded(kotlin.Boolean))`(`finalChunk:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a read succeeds. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRewindError](#onRewindError(java.lang.Exception))`(`exception:` `[Exception](../../../java/lang/Exception.html#)`)` Called by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a rewind fails, or if rewinding uploads is not supported. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRewindSucceeded](#onRewindSucceeded())`()` Called by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a rewind succeeds. |\n\nPublic constructors\n-------------------\n\n### UploadDataSink\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nUploadDataSink()\n```\n\nPublic methods\n--------------\n\n### onReadError\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onReadError(exception: Exception): Unit\n```\n\nCalled by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a read fails.\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------------------------------------|\n| `exception` | [Exception](../../../java/lang/Exception.html#): Exception passed on to the embedder. This value cannot be `null`. |\n\n### onReadSucceeded\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onReadSucceeded(finalChunk: Boolean): Unit\n```\n\nCalled by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a read succeeds.\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `finalChunk` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): For chunked uploads, `true` if this is the final read. It must be `false` for non-chunked uploads. |\n\n### onRewindError\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onRewindError(exception: Exception): Unit\n```\n\nCalled by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a rewind fails, or if rewinding uploads is not supported.\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------------------------------------|\n| `exception` | [Exception](../../../java/lang/Exception.html#): Exception passed on to the embedder. This value cannot be `null`. |\n\n### onRewindSucceeded\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onRewindSucceeded(): Unit\n```\n\nCalled by [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) when a rewind succeeds."]]