I am trying to save a base64 decoded string into a zip file using the mentioned code:
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("/home/wemohamm/Desktop/test.zip")));
out.write(decodedString);
out.close();
Here decodedString
contains base64 decoded string and I can output it.
I am running the code in rhel6 with Java 1.6. When I try to open the zip, it says error occurred while opening file.
The same code if I use with Windows 7 Java 1.6 with path c:\\test\test.zip
is working fine.
Is the zip not getting saved correctly in rhel6 or if there is any code modifications I need to do?