Android Utililty Methods Byte Array to Bitmap Convert

List of utility methods to do Byte Array to Bitmap Convert

Description

The list of methods to do Byte Array to Bitmap Convert are organized into topic(s).

Method

BitmapbyteToBitmap(byte[] iconByte)
byte To Bitmap
return BitmapFactory.decodeByteArray(iconByte, 0, iconByte.length);
BitmapByteStringToBitmap(ByteString bytes)
Byte String To Bitmap
Bitmap bitmap;
ByteArrayInputStream inputStream = new ByteArrayInputStream(
        bytes.toByteArray());
bitmap = BitmapFactory.decodeStream(inputStream).copy(
        Bitmap.Config.ARGB_8888, true);
inputStream.close();
return bitmap;
BitmapdecodeSampledBitmapFromData(byte[] data)
decode Sampled Bitmap From Data
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeByteArray(data, 0, data.length, options);
options.inSampleSize = 1; 
options.inJustDecodeBounds = false;
return BitmapFactory.decodeByteArray(data, 0, data.length, options);
Bitmapbytes2Bimap(byte[] b)
bytes Bimap
Bitmap bitmap = null;
try {
    if (b.length != 0) {
        bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
} catch (Exception e) {
    e.printStackTrace();
return bitmap;
Bitmapbytes2Bimap(byte[] bytes)
bytes Bimap
if (bytes.length != 0) {
    return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
} else {
    return null;