1)What kind of file you split in your code?
2)Did you verify that the splitting part is correct? (i.e. the content of each file is the same as the original file)
3)I am not sure whether the EOF is included in the file size. In other words, only 1 EOF will be in 1 file but it will add up after splitting (count for each smaller file).
4)Could you please follow the java name convension??? A method name should begins with lower case and start with an action word. Preserve the upper case of the first letter for class name. Preserve all upper case letters for constant variables.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
No no, I am talking about verify each file against the original file. For example, original file contains "0123456789" and you split the file into 5 files. So file 1 should contains '01', file 2 should contains '23', and so on. That's what I mean by the same content.
By the way, what does "not work" mean? Please explain and give an example of the input-output.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
OK, it will never join the file. Have you tried to print out (System.out) and check the file.length and the nChunks values? You will see what I mean...
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
You still don't get it... The nChunks value will be the same as your files.length. If it is equal, how would it enter that if clause? So do you still stand correct on the if clause right now?
PS: If you still don't understand. Check how you count each part of the split file number. Then would the total number of the split file number be equal to the total number of files you have? This is a number, not array index.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17