I am getting a JSON response from webservice call as
]1
I have to save this file to my system. I am using the following code:
BASE64Decoder decoder = new BASE64Decoder();
byte[] decodedBytes = decoder.decodeBuffer(response);
ByteArrayInputStream bis = new ByteArrayInputStream(decodedBytes);
bis.close();
File file = new File("C:/image one.jpeg");
FileOutputStream fop = new FileOutputStream(file);
fop.write(decodedBytes);
fop.flush();
fop.close();
The file gets saved but is corrupt and can't be opened. Can anybody shed some light on what I am doing wrong?