Here you can find the source of getBitmapFromFileInputStream(FileInputStream is)
public static Bitmap getBitmapFromFileInputStream(FileInputStream is)
//License from project: Open Source License import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import org.ixming.android.utils.FrameworkLog; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; public class Main{ static final String TAG = "sharebind_bitmaputil"; public static Bitmap getBitmapFromFileInputStream(FileInputStream is) { if (is == null) return null; Bitmap bitmap = null;/* w w w . j ava 2s. c om*/ try { BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Config.RGB_565; options.inPurgeable = true; options.inInputShareable = true; bitmap = BitmapFactory.decodeFileDescriptor(is.getFD(), null, options); } catch (Exception e) { bitmap = null; FrameworkLog.e(TAG, "getBitmapFromFileInputStream Exception: " + e.getMessage()); } finally { if (is != null) { try { is.close(); } catch (Exception e) { } } } return bitmap; } }