赞
踩
- package com.dylan.io;
-
- import java.io.BufferedOutputStream;
- import java.io.FileOutputStream;
-
- /**
- * @author xusucheng
- * @create 2018-01-01
- **/
- public class BufferedOutputStreamExample {
- public static void main(String[] args) {
- FileOutputStream fout = null;
- try {
- fout = new FileOutputStream("D:\\testout.txt");
- BufferedOutputStream bout = new BufferedOutputStream(fout);
- String s = "北京欢迎你!";
- byte b[] = s.getBytes();
- bout.write(b);
- bout.flush();
- bout.close();
- fout.close();
- System.out.println("写入成功!");
- } catch (java.io.IOException e) {
- e.printStackTrace();
- }
-
- }
- }
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。