I tried to copy a file following the example in the
java and nutshell tutorials as listed below. I wrote a
junit test that creates a file with one line of text. The file is there, it is found and opened and the text is there too until the call of file.read(buffer). That method returns -1, after the call the source file is empty and nothing is written to the targetFile.
Could that be connected to the 8 and 16bit problem mentioned in the java tutorial?
"Remember that FileReader and FileWriter read and write 16-bit characters. However, most native file systems are based on 8-bit bytes. These streams encode the characters as they operate according to the default character-encoding scheme. You can find out the default character-encoding by using System.getProperty("file.encoding"). To specify an encoding other than the default,
you should construct an OutputStreamWriter on a FileOutputStream and specify the encoding."
Does anybody has a fileCopy function that copies any sort of file?
Thanks for help!
[ March 07, 2006: Message edited by: Jim Yingst ]