Android Bitmap from Byte Array Create convertByteArrayToBitmap(byte[] b)

Here you can find the source of convertByteArrayToBitmap(byte[] b)

Description

convert Byte Array To Bitmap

Declaration

public static Bitmap convertByteArrayToBitmap(byte[] b) 

Method Source Code

//package com.java2s;
import java.io.ByteArrayInputStream;

import android.graphics.Bitmap;

import android.graphics.BitmapFactory;

public class Main {
    public static Bitmap convertByteArrayToBitmap(byte[] b) {
        if (b == null) {
            return null;
        }//from  w ww .j a  v a 2  s .  co m

        ByteArrayInputStream imageStream = new ByteArrayInputStream(b);
        Bitmap theImage = BitmapFactory.decodeStream(imageStream);
        return theImage;
    }
}

Related

  1. makeBitmap(byte[] jpegData, int maxNumOfPixels)
  2. unFlattenBitmap(byte[] bitmapData)
  3. getBitmapImage(Context context, String base64)
  4. Bytes2Bimap(byte[] b)
  5. bytes2Bimap(byte[] b)
  6. byteToBitmap(byte[] byteArray)