public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader (new FileReader("xxx.txt"));
BufferedWriter bw = new BufferedWriter (new FileWriter("yyy.txt"));
int c;
while((c = br.read()) != -1){
bw.write(c);
}
br.close();
bw.close();
}