Stay organized with collections
Save and categorize content based on your preferences.
PipeDataWriter
interface PipeDataWriter<T : Any!>
Interface to write a stream of data to a pipe. Use with ContentProvider.openPipeHelper
.
Summary
Public methods |
abstract Unit |
Called from a background thread to stream data out to a pipe.
|
Public methods
writeDataToPipe
abstract fun writeDataToPipe(
output: ParcelFileDescriptor,
uri: Uri,
mimeType: String,
opts: Bundle?,
args: T?
): Unit
Called from a background thread to stream data out to a pipe. Note that the pipe is blocking, so this thread can block on writes for an arbitrary amount of time if the client is slow at reading.
Parameters |
output |
ParcelFileDescriptor: The pipe where data should be written. This will be closed for you upon returning from this function. This value cannot be null . |
uri |
Uri: The URI whose data is to be written. This value cannot be null . |
mimeType |
String: The desired type of data to be written. This value cannot be null . |
opts |
Bundle?: Options supplied by caller. This value may be null . |
args |
T?: Your own custom arguments. This value may 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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ContentProvider.PipeDataWriter\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPipeDataWriter\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/content/ContentProvider.PipeDataWriter \"View this page in Java\") \n\n```\ninterface PipeDataWriter\u003cT : Any!\u003e\n```\n\n|-----------------------------------------------------|\n| [android.content.ContentProvider.PipeDataWriter](#) |\n\nInterface to write a stream of data to a pipe. Use with [ContentProvider.openPipeHelper](/reference/kotlin/android/content/ContentProvider#openPipeHelper(android.net.Uri,%20kotlin.String,%20android.os.Bundle,%20android.content.ContentProvider.openPipeHelper.T,%20android.content.ContentProvider.PipeDataWriter)).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [writeDataToPipe](#writeDataToPipe(android.os.ParcelFileDescriptor,%20android.net.Uri,%20kotlin.String,%20android.os.Bundle,%20android.content.ContentProvider.PipeDataWriter.T))`(`output:` `[ParcelFileDescriptor](../os/ParcelFileDescriptor.html#)`, `uri:` `[Uri](../net/Uri.html#)`, `mimeType:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `opts:` `[Bundle](../os/Bundle.html#)?`, `args:` `T?`)` Called from a background thread to stream data out to a pipe. |\n\nPublic methods\n--------------\n\n### writeDataToPipe\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun writeDataToPipe(\n output: ParcelFileDescriptor, \n uri: Uri, \n mimeType: String, \n opts: Bundle?, \n args: T?\n): Unit\n```\n\nCalled from a background thread to stream data out to a pipe. Note that the pipe is blocking, so this thread can block on writes for an arbitrary amount of time if the client is slow at reading.\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `output` | [ParcelFileDescriptor](../os/ParcelFileDescriptor.html#): The pipe where data should be written. This will be closed for you upon returning from this function. This value cannot be `null`. |\n| `uri` | [Uri](../net/Uri.html#): The URI whose data is to be written. This value cannot be `null`. |\n| `mimeType` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The desired type of data to be written. This value cannot be `null`. |\n| `opts` | [Bundle](../os/Bundle.html#)?: Options supplied by caller. This value may be `null`. |\n| `args` | T?: Your own custom arguments. This value may be `null`. |"]]