读书人

IO(2)

发布时间: 2012-10-16 09:57:37 作者: rapoo

IO(二)
代码例子:

package com.test;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStream;public class OutputStreamTest{public static void main(String[] args) throws IOException{OutputStream os =new FileOutputStream("C:/hello.txt");String str = "hello world";byte[] buffer = str.getBytes();os.write(buffer);os.close();}}

帅哥,你过奖了

读书人网 >编程

热点推荐