- 9
- 0
- 约9.79千字
- 约 33页
- 2017-06-30 发布于湖北
- 举报
mj2se(IO流)
示例 public class TestTransForm1 { public static void main(String[] args) throws Exception { OutputStreamWriter osw = new OutputStreamWriter( new FileOutputStream(d:\\bak\\char.txt));//创建osw对象 osw.write(mircosoftibmsunapplehp);//向文件中写入内容 System.out.println(osw.getEncoding());//打印当前使用的编码 osw.close(); osw = new OutputStreamWriter( new FileOutputStream(d:\\bak\\char.txt, true), “ISO8859_1”); //更换编码 osw.write(mircosoftibmsunapplehp); System.out.println(osw.getEncoding()); osw.close(); } } ObjectInputStreamObjectOutPutStream
原创力文档

文档评论(0)