Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * Licensed Materials - Property of IBM
 *  Copyright IBM Corporation 2015. All Rights Reserved.
 */

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

public class Main {
    /**
     * Decodes a base-64 byte array representation into a Bitmap. Call the
     * setImageBitmap method on an ImageView with the returned Bitmap object.
     *
     * @param data the raw base-64 image data
     * @return the converted Bitmap that can be used as an ImageView source
     */
    public static Bitmap decodeBase64Image(byte[] data) {
        return BitmapFactory.decodeByteArray(data, 0, data.length);
    }
}