pipaxing

Posted yrswby2016

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pipaxing相关的知识,希望对你有一定的参考价值。

public class Three {
public static void main(String[] args) {
try{
changeEncoding("GBK","UTF-8","ccom\xxdc\琵琶行_GBK.txt","20190810\琵琶行_UTF8.txt");
} catch (IOException e) {
e.printStackTrace();
}


}
public static void changeEncoding (String inEncoding, String outEncoding,
String inFileName, String outFileName) throws IOException {
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream(inFileName), inEncoding));
BufferedWriter writer = new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(outFileName), outEncoding));
String s = null;
while ((s = reader.readLine()) != null) {
writer.write(s,0, s.length());
writer.newLine();
}
writer.flush();
writer.close();
reader.close();
}
}

以上是关于pipaxing的主要内容,如果未能解决你的问题,请参考以下文章