@UnstableApi
public final class BitmapUtil


Utility methods for Bitmap instances.

Summary

Public methods

static Bitmap
decode(
    byte[] data,
    int length,
    @Nullable BitmapFactory.Options options,
    int maximumOutputDimension
)

Decodes a Bitmap from a byte array using BitmapFactory and the .

Public methods

decode

public static Bitmap decode(
    byte[] data,
    int length,
    @Nullable BitmapFactory.Options options,
    int maximumOutputDimension
)

Decodes a Bitmap from a byte array using BitmapFactory and the .

Parameters
byte[] data

Byte array of compressed image data.

int length

The number of bytes to parse.

@Nullable BitmapFactory.Options options

The BitmapFactory.Options to decode the data with.

int maximumOutputDimension

The largest output Bitmap dimension that can be returned by this method, or LENGTH_UNSET if no limits are enforced.

Throws
androidx.media3.common.ParserException

if the data could not be decoded.

java.io.IOException