Stay organized with collections
Save and categorize content based on your preferences.
DecodeException
class DecodeException : IOException
Information about an interrupted decode.
Summary
Constants |
static Int |
An Exception was thrown reading the Source .
|
static Int |
The encoded data was incomplete.
|
static Int |
The encoded data contained an error.
|
Constants
SOURCE_EXCEPTION
static val SOURCE_EXCEPTION: Int
An Exception was thrown reading the Source
.
Value: 1
SOURCE_INCOMPLETE
static val SOURCE_INCOMPLETE: Int
The encoded data was incomplete.
Value: 2
static val SOURCE_MALFORMED_DATA: Int
The encoded data contained an error.
Value: 3
Public methods
getSource
fun getSource(): ImageDecoder.Source
Retrieve the Source
that was interrupted.
This can be used for equality checking to find the Source which failed to completely decode.
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,["# ImageDecoder.DecodeException\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDecodeException\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/graphics/ImageDecoder.DecodeException \"View this page in Java\") \n\n```\nclass DecodeException : IOException\n```\n\n|---|---|---|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) ||||\n| | ↳ | [java.lang.Exception](../../java/lang/Exception.html#) |||\n| | | ↳ | [java.io.IOException](../../java/io/IOException.html#) ||\n| | | | ↳ | [android.graphics.ImageDecoder.DecodeException](#) |\n\nInformation about an interrupted decode.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_EXCEPTION](#SOURCE_EXCEPTION:kotlin.Int) An Exception was thrown reading the [Source](/reference/kotlin/android/graphics/ImageDecoder.Source). |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_INCOMPLETE](#SOURCE_INCOMPLETE:kotlin.Int) The encoded data was incomplete. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SOURCE_MALFORMED_DATA](#SOURCE_MALFORMED_DATA:kotlin.Int) The encoded data contained an error. |\n\n| Public methods ||\n|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getError](#getError())`()` Retrieve the reason that decoding was interrupted. |\n| [ImageDecoder.Source](/reference/kotlin/android/graphics/ImageDecoder.Source) | [getSource](#getSource())`()` Retrieve the [Source](/reference/kotlin/android/graphics/ImageDecoder.Source) that was interrupted. |\n\nConstants\n---------\n\n### SOURCE_EXCEPTION\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SOURCE_EXCEPTION: Int\n```\n\nAn Exception was thrown reading the [Source](/reference/kotlin/android/graphics/ImageDecoder.Source). \n\n Value: 1\n\n### SOURCE_INCOMPLETE\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SOURCE_INCOMPLETE: Int\n```\n\nThe encoded data was incomplete. \n\n Value: 2\n\n### SOURCE_MALFORMED_DATA\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SOURCE_MALFORMED_DATA: Int\n```\n\nThe encoded data contained an error. \n\n Value: 3\n\nPublic methods\n--------------\n\n### getError\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getError(): Int\n```\n\nRetrieve the reason that decoding was interrupted.\n\nIf the error is [SOURCE_EXCEPTION](#SOURCE_EXCEPTION:kotlin.Int), the underlying [java.lang.Throwable](../../java/lang/Throwable.html#) can be retrieved with [java.lang.Throwable#getCause](../../java/lang/Throwable.html#getCause()).\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is [android.graphics.ImageDecoder.DecodeException#SOURCE_EXCEPTION](#SOURCE_EXCEPTION:kotlin.Int), [android.graphics.ImageDecoder.DecodeException#SOURCE_INCOMPLETE](#SOURCE_INCOMPLETE:kotlin.Int), or [android.graphics.ImageDecoder.DecodeException#SOURCE_MALFORMED_DATA](#SOURCE_MALFORMED_DATA:kotlin.Int) |\n\n### getSource\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSource(): ImageDecoder.Source\n```\n\nRetrieve the [Source](/reference/kotlin/android/graphics/ImageDecoder.Source) that was interrupted.\n\nThis can be used for equality checking to find the Source which failed to completely decode.\n\n| Return ||\n|-------------------------------------------------------------------------------|------------------------------|\n| [ImageDecoder.Source](/reference/kotlin/android/graphics/ImageDecoder.Source) | This value cannot be `null`. |"]]