bufferwriter 没有写入文件。请问谁能告诉我可能是什么问题
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
public class main {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Writer output = null;
File file = new File("D:/junk/CI_CSSOIDs sql_query/orphans.log");
output = new BufferedWriter(new FileWriter(file));
java.io.FileReader fr = new FileReader( "D:/junk/CI_CSSOIDs ql_query/SQL_CSSO.log" ) ;
java.io.BufferedReader reader = new BufferedReader( fr ) ;
int orphancount=0;
String line = null ;
int count =1;
while( ( line = reader.readLine() ) != null )
{
String words[]=line.split(" ");
for (int i =0;i<words.length;i++){
if (words[i].length()==32){
String CIline=null;
java.io.FileReader CIfr = new FileReader( "D:/junk/CI_CSSOIDs sql_query/CI.log" ) ;
java.io.BufferedReader CIreader = new BufferedReader( CIfr ) ;
boolean orphan = true;
while((CIline=CIreader.readLine())!=null){
if (CIline.contains(words[i])){
orphan=false;
break;
}
}
if(orphan){
orphancount++;
output.write("####"+words[i]+"*****\n");
System.out.println(words[i]+" : is an orphan CSSOID");
}
}
}
count++;
}
System.out.println("Orphan count is :"+orphancount);
}
}