In my android application. I got binary code from a jpeg image from the code as follows.
byte[] val = stream.toByteArray();
BigInteger bi = new BigInteger(val);
String s = bi.toString(2);
This string s prints the binary value of the image.
My question is how to convert this binary format into a jpeg image??
I’m not really sure what you want.
If you want to create a
Bitmap-instance directly from the stream you can useBitmapFactoryand display thatBitmapin anImageView-instance afterwards:If you want to convert your string representation with radix 2 back to a binary array you can use
BigIntegertoo: