zoukankan      html  css  js  c++  java
  • OutputStreamWriter写的转化流

    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    
    public class Demo03OutputStreamWriter {
        public static void main(String[] args) throws IOException {
    
            write_utf_8();
            write_GBK();
    
        }
    
        private static void write_GBK() throws IOException {
            OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("F:\basic\untitled13\src\it\cast\day15\demo05\gbk.txt"),"GBK");
            osw.write("你好gbk");
            osw.flush();
            osw.close();
        }
    
        private static void write_utf_8() throws IOException {//utf-8格式的文件
            OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("F:\basic\untitled13\src\it\cast\day15\demo05\utf_8.txt"),"UTF-8");
            osw.write("你好utf-8");
            osw.flush();
            osw.close();
        }
    }
  • 相关阅读:
    1.表单标签
    07.Ajax.post
    06.Ajax.get
    05.Ajax.get
    04.Ajax-get.html
    03.post.file
    nodejs-7.2. CURD数据管理系统小栗子
    nodejs-7.1. mongoose模块
    JS 无缝轮播图1-节点操作
    JS 放大镜特效
  • 原文地址:https://www.cnblogs.com/cy2268540857/p/13799328.html
Copyright © 2011-2022 走看看