Hi there,
I am working on a project to read the content of all the files in one directory and put them into one new
java file. I am using readline() to read the content of the file. But when I encounter some text like /**, it return null. Anyone does the samething?
/** My code **/
if(aFile.isFile())
{
try
{
RandomAccessFile r = new RandomAccessFile(sPath + "\\" + oneFile, "r");
StringBuffer buf = new StringBuffer();
String text;
while((text = r.readLine() ) != null)
{
buf.append(r.readLine() + "\n");
System.out.println(r.readLine());
}
output.writeBytes(buf.toString() + "\n");
}
catch (IOException e)
{
System.err.println(e.toString());
System.exit(1);
}
}
Thanks!
qionghua