android - Unable to convert bitmap image into byte[] -
I want to convert my captured image to byte [] When I capture the image using the camera It is captured and preview is also shown and images successfully save successfully on my external storage. But when I try to change my preview image it does not store anything in the byte array. The following is my method which is called the preview image button on my phone. public static zoom previewed image () {try {Static ByteArrayOutputStream stream = null} imgPreview.setVisibility (View.VISIBLE); Bitmapfactor Option option = new bitmapfile the option (); Options.inSampleSize = 8; Last bitmap bitmap = bitmapfile Decodefile (fileUri.getPath (), option); ImgPreview.setImageBitmap (bitmap); Stream = new byteOutStream (); Bitmap.compress (CompressFormat.JPEG, 100, Stream); Byte [] Biteire = Stream. To Batere (); } Hold (NullPointerException e) {e.printStackTrace (); }} Convert image to string & amp; Byte array, use less than code. Bytereutputstream baoos = new byteOnputstream (...