question: public static byte [ ] toByteArray ( Bitmap bitmap ) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; bitmap . compress ( Bitmap . CompressFormat . PNG , 0 , outputStream ) ; return outputStream . toByteArray ( ) ; }
target:  Copies a bitmap's pixels to a byte array.