android-components / mozilla.components.browser.icons.decoder / IconDecoder


interface IconDecoder (source)

An icon decoder that can decode a ByteArray into a Bitmap.

Depending on the image format the decoder may internally decode the ByteArray into multiple Bitmap. It is up to the decoder implementation to return the best Bitmap to use.


Name Summary
ImageMagicNumbers enum class ImageMagicNumbers


Name Summary
decode abstract fun decode(data: ByteArray, desiredSize: DesiredSize): <ERROR CLASS>?
Decodes the given data into a a Bitmap or null.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.


Name Summary
AndroidIconDecoder class AndroidIconDecoder : IconDecoder
IconDecoder that will use Android’s BitmapFactory in order to decode the byte data.
ICOIconDecoder class ICOIconDecoder : IconDecoder
IconDecoder implementation for decoding ICO files.