String readPath = "";
String writePath = "";
BufferedReader in = null;
BufferedWriter os = null;
try {
// 读取文件(readPaht)内容
if(null != in){
in.close();
}
in = new BufferedReader(new InputStreamReader(new FileInputStream(readPath)));
//
if(null != os){
os.close();
}
os = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(writePath)));
String line = in.readLine();
while (null != line && !"".equals(line)) {
os.write(line);
os.newLine();
line = in.readLine();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try{
if(null != in){
in.close();
}
if(null != os){
os.close();
}
}catch (Exception e) {
e.printStackTrace();
}
}