I am trying to convert byte array into image in android.
I have a ArrayList<Byte> arrays;
that contains all byte arrays that I want to convert.
Now at
byt = (byte[]) arrays.get(0);
its giving me Cannot cast from Byte to byte[] java
exception.
byte[] byt;
byt = new byte[4096];
byt = (byte[]) arrays.get(0) ;
BufferedImage bImageFromConvert = null;
InputStream in = new ByteArrayInputStream(byt);
try {
bImageFromConvert = ImageIO.read(in);
SaveImages();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
How can I solve this?