本帖最后由 ehuashao 于 2014-4-1 14:14 编辑
- public class FileTest {
- public static void main(String[] args) throws Exception {
- FileInputStream fin = new FileInputStream(new File("f://Demo.txt"));
- FileOutputStream fout =new FileOutputStream("f://11.txt");
- InputStreamReader in = new InputStreamReader(fin);
- OutputStreamWriter out = new OutputStreamWriter(fout,"gb2312");
- int b;
- while((b=in.read()) != -1){
- fout.write(b);
- }
-
- }
- }
复制代码 对java io流,完全不会啊,自己摸索着写,字节流读入,然后转字符流,输出的中文全是乱码,设置了输出编码为 utf-8依然乱码求解啊。
|
|