package day21;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class InputStreamreader {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(new FileInputStream("aaa.txt"),"utf-8");
OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("bbb.txt"),"gbk");
int b;
while((b = isr.read()) != -1){
osw.write(b);
}
isr.close();
osw.close();
}
}
|
|