I have block of hexadecimal data which i want to write in a file as it is.
Block 000100050000470040002E000000000099009900500000000000490067008D0000000000890081007600000000004C002F0027000000000200050000470040002E0000000000000D00590065006C006C006F00770020006F006C0069007600650000000099009900500000000000000D004F006C006900760065002000790065006C006C006F007700000000490067008D0000000000000D00440069007300740061006E007400200062006C00750065000000008900810076000000000000110050006500610072006C0020006D006F00750073006500200067007200650079000000004C002F00270000000000000F004D00610068006F00670061006E0079002000620072006F0077006E0000
Above block represent a Adobe .aco (stores a color palette) file .
Similar File opened in hex editor shows:-
On trying to write Given block using
Code
try {
File ACO = new File(f.getAbsolutePath(),"NameRandom.aco");
ACO.createNewFile();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(ACO)));
try {
writer.write(<-- Above Block -->);
} finally {
writer.close();
}
} catch (IOException e) {
e.printStackTrace();
}
But the above code shows different in hed Editor (as Following image)
I want to write Given block as it is in its current state in file.