Android Bitmap to OutputStream Convert getOutputStream(final Bitmap bitmap)

Here you can find the source of getOutputStream(final Bitmap bitmap)

Description

get Output Stream

Declaration

public static OutputStream getOutputStream(final Bitmap bitmap) 

Method Source Code

//package com.java2s;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;

import android.graphics.Bitmap;

public class Main {
    public static OutputStream getOutputStream(final Bitmap bitmap) {
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
        return stream;
    }//from w  w w.ja  v  a 2 s  .  c  om
}