ImageDecoder.DecodeException


public static final class ImageDecoder.DecodeException
extends IOException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.io.IOException
         ↳ android.graphics.ImageDecoder.DecodeException


Information about an interrupted decode.

Summary

Constants

int GAINMAP_EXTRACTION_FAILED

The extraction of the gainmap component of the image failed.

int SOURCE_EXCEPTION

An Exception was thrown reading the Source.

int SOURCE_INCOMPLETE

The encoded data was incomplete.

int SOURCE_MALFORMED_DATA

The encoded data contained an error.

Public methods

int getError()

Retrieve the reason that decoding was interrupted.

ImageDecoder.Source getSource()

Retrieve the Source that was interrupted.

Inherited methods

Constants

GAINMAP_EXTRACTION_FAILED

Added in API level 10000
public static final int GAINMAP_EXTRACTION_FAILED

The extraction of the gainmap component of the image failed. If the partially decoded result is returned by returning true from OnPartialImageListener.onPartialImage(DecodeException) there will still be a complete base image to be viewed. It is thus recommended to return the partial image and proceed with displaying it. Applications that are doing this for editing or similar may want to consider warning the user that data was lost.

Constant Value: 4 (0x00000004)

SOURCE_EXCEPTION

Added in API level 28
public static final int SOURCE_EXCEPTION

An Exception was thrown reading the Source.

Constant Value: 1 (0x00000001)

SOURCE_INCOMPLETE

Added in API level 28
public static final int SOURCE_INCOMPLETE

The encoded data was incomplete.

Constant Value: 2 (0x00000002)

SOURCE_MALFORMED_DATA

Added in API level 28
public static final int SOURCE_MALFORMED_DATA

The encoded data contained an error.

Constant Value: 3 (0x00000003)

Public methods

getError

Added in API level 28
public int getError ()

Retrieve the reason that decoding was interrupted.

If the error is SOURCE_EXCEPTION, the underlying Throwable can be retrieved with Throwable.getCause().

Returns
int Value is one of the following:

getSource

Added in API level 28
public ImageDecoder.Source getSource ()

Retrieve the Source that was interrupted.

This can be used for equality checking to find the Source which failed to completely decode.

Returns
ImageDecoder.Source This value cannot be null.