package com.itbuluoge.nio;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class WriteFile {

/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
/*写入到文件*/
FileOutputStream fout=new FileOutputStream("data.out");
fout.write("itbuluoge".getBytes());
fout.close();
}

}

最简单的一个例子