자바 토큰 토크나이져(StringTokenizer)로 파일입력 파일출력

import java.io.*;
import java.util.*;

public class A
{

  public static void main(String[] args) throws IOException{
FileInputStream fin = new FileInputStream(“a.txt”);
BufferedReader in =  new BufferedReader((new InputStreamReader(fin, “UTF-8”)));
BufferedWriter Bout =  new BufferedWriter(new FileWriter(“B.txt”));
BufferedWriter Cout =  new BufferedWriter(new FileWriter(“C.txt”));

    String temp;
int key = 0;
while((temp = in.readLine()) != null) {
if (temp.indexOf(“론대학교다”)>0)
{
key = 0;
}else if (temp.indexOf(“론전문대학교”)>0)
   {
key = 1;
}
StringTokenizer st = new StringTokenizer(temp,”:,”);
String[] tempstr = new String[st.countTokens()];
int cnttoken = st.countTokens();
int i = 0;
if(key==0) {
while(st.hasMoreTokens()) {
temp=st.nextToken();
temp.trim();
tempstr[i]=temp;
if(cnttoken > 1 && i != 0) {
Bout.write(tempstr[0]);
Bout.write(“,”);
Bout.write(tempstr[i]);
Bout.newLine();
}
i++;
}
}
if(key==1) {
while(st.hasMoreTokens()) {
temp=st.nextToken();
temp.trim();
tempstr[i]=temp;
if(cnttoken > 1 && i != 0) {
Cout.write(tempstr[0]);
Cout.write(“,”);
Cout.write(tempstr[i]);
Cout.newLine();
}
i++;
}
}
}
in.close();
Bout.close();
Cout.close();
}
}