Here you can find the source of toBitmapDrawable(InputStream is)
public static BitmapDrawable toBitmapDrawable(InputStream is) throws IOException
//package com.java2s; import android.graphics.drawable.BitmapDrawable; import java.io.*; public class Main { public static BitmapDrawable toBitmapDrawable(InputStream is) throws IOException { BitmapDrawable bitmapDrawable = new BitmapDrawable(is); is.close();//from w w w .j ava 2 s. c o m return bitmapDrawable; } }