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();}}