I am giving directory path and trying to copy data of all files in that directory to a file.But, it is writing data of only file.Can anyone tell,how can i copy data of n files in one file.Below is my code :
I don't think it's related to your problem but you need to put the fileInputStream.close(); inside your while loop. You are only closing the last file you read at the moment. Also, unless you are practising using while loops this would be much better as a for loop