这是我自己写的,是不是哪里错了?
import *;
public class PrintDataFromSbi {
public static void main(String[] args) {
int b = 0;
FileInputStream in =null;
FileOutputStream out = null;
DataOutputStream dos = null;
try {
in = new FileInputStream ("c:\\student.txt");
dos = new DataOutputStream(new FileOutputStream("c:\\sbi.dat"));
while((b = in.read()) != -1){
dos.writeChar((char)b);
}
in.close();
//out.close();
dos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}