Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {
    public static Bitmap convertByteArrayToBitmap(byte[] byteArray) {
        if (byteArray != null) {
            ByteArrayInputStream imageStream = new ByteArrayInputStream(byteArray);
            return BitmapFactory.decodeStream(imageStream);
        } else {
            return null;
        }
    }
}