Java tutorial
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap decodeStream(InputStream is) throws IOException { Bitmap b = BitmapFactory.decodeStream(is); if (b == null) { throw new IOException("Failed to create bitmap, decodeStream() returned null"); } return b; } }