import java.io.*;
public class OutputStr
{
    public static void main(String[] args) throws Exception
    {
        File file = new File("D:\\temp","write.txt");
        OutputStream os = new FileOutputStream(file);
    //    os.write(89); //参数是 int类型
        String str = "haahahahah";
        os.write(str.getBytes());
          os.flush();//清空缓存
        os.close();
    }
}