public InputStream bitmapToInputStream(Bitmap myBitmap) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
myBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
ByteArrayInputStream byteArrInputStream = new ByteArrayInputStream(
baos.toByteArray());
return byteArrInputStream;
}