question: public static byte [ ] toBytes ( Bitmap bmp ) { ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; bmp . compress ( Bitmap . CompressFormat . PNG , 100 , stream ) ; return stream . toByteArray ( ) ; }
target:  Converts a given bitmap to byte array