Java tutorial
//package com.java2s; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import android.graphics.Bitmap; public class Main { public static InputStream Bitmap2IS(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // What about 50... bm.compress(Bitmap.CompressFormat.JPEG, 50, baos); InputStream sbs = new ByteArrayInputStream(baos.toByteArray()); return sbs; } }