Stay organized with collections
Save and categorize content based on your preferences.
interface ByteArrayDataSource.UriResolver
Functional interface to resolve from Uri
to byte[]
.
Summary
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-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# ByteArrayDataSource.UriResolver\n===============================\n\nArtifact: [androidx.media3:media3-datasource](/jetpack/androidx/releases/media3) \n[View Source](https://cs.android.com/search?q=file:androidx/media3/datasource/ByteArrayDataSource.java+class:androidx.media3.datasource.ByteArrayDataSource.UriResolver)\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/media3/datasource/ByteArrayDataSource.UriResolver \"View this page in Java\")\n\n\n```\ninterface ByteArrayDataSource.UriResolver\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nFunctional interface to resolve from [Uri](https://developer.android.com/reference/android/net/Uri.html) to `byte[]`.\n\nSummary\n-------\n\n| ### Public functions |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ByteArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html)`\u003c`[Byte](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html)`\u003e!` | [resolve](/reference/kotlin/androidx/media3/datasource/ByteArrayDataSource.UriResolver#resolve(android.net.Uri))`(uri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)`!)` Resolves a [Uri](https://developer.android.com/reference/android/net/Uri.html) to a `byte[]`. |\n\nPublic functions\n----------------\n\n### resolve\n\n```\nfun resolve(uri: Uri!): ByteArray\u003cByte\u003e!\n```\n\nResolves a [Uri](https://developer.android.com/reference/android/net/Uri.html) to a `byte[]`.\n\nCalled during [open](/reference/kotlin/androidx/media3/datasource/DataSource#open(androidx.media3.datasource.DataSpec)) from a loading thread, so can do blocking work. \n\n| Returns |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|\n| [ByteArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html)`\u003c`[Byte](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html)`\u003e!` | The resolved byte array. |\n\n| Throws |\n|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------|\n| [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) | if the provided URI is not recognized, or an error occurs during resolution. |"]]