Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

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 SOURCE_EXCEPTION

An Exception was thrown reading the ImageDecoder.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

SOURCE_EXCEPTION

added in API level 28
public static final int SOURCE_EXCEPTION

An Exception was thrown reading the ImageDecoder.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 SOURCE_EXCEPTION, SOURCE_INCOMPLETE or SOURCE_MALFORMED_DATA.

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 will never be null.