Created
June 12, 2014 09:26
-
-
Save laaptu/d17d9f921f264c087508 to your computer and use it in GitHub Desktop.
Convert Bitmap to InputStream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
bitmap.compress(CompressFormat.PNG, 0 /*ignored for PNG*/, bos); | |
byte[] bitmapdata = bos.toByteArray(); | |
ByteArrayInputStream bs = new ByteArrayInputStream(bitmapdata); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment