I am trying to divide a binary file (like video/audio/image) into chunks of 100kb each and then join those chunks back to get back the original file. My code seems to be wor
And for joining file, I put the names of all chunks in a List, then sort it by name and then run the following code:
But your names are of the following form:
newName = fname + ".part" + Integer.toString(nChunks - 1);
Think carefully about what happens if you have 11 or more parts. Which string comes first in alphabetical order: ".part10" or ".part2"? (Answer: ".part10", since '1' comes before '2' in the character encoding.)