I have merged multiple jpeg files into one single .bin file.
.....
.........
while(true){
if (q.numOfFiles() > 0) {
source = q.getNextFile();
in = new DataInputStream(new BufferedInputStream(new FileInputStream(source)));
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
String s = "filename=="+source.getName()+"==filename";
out.write(s.getBytes());
out.flush();
System.out.println("merged--"+source.getName());
}
}
........
........
as you can see i am appending “filename==”+source.getName()+”==filename” after end of each file.
Now i want to separate all those jpegs with their actual file names.
How can i read the separators that I’ve inserted in the merged files ?
As above in the comments:
Sugestion/answer to adapt your point of view:
Using a single file zip to ship multiple files.
How to create zip in Java
And to extract:
Extract from zip in Java