A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

FileOutputStream写出数据
                   A:操作步骤
                            a:创建字节输出流对象
                            b:调用write()方法
                                     publicvoid write(int b):写一个字节
                                     publicvoid write(byte[] b):写一个字节数组
                                     publicvoid write(byte[] b,int off,int len):写一个字节数组的一部分,off序号开始写len个字节
                            c:释放资源
                           
                   B:代码体现:
                            FileOutputStreamfos = new FileOutputStream("fos.txt");
                            fos.write("hello".getBytes());
                            fos.close();

1 个回复

倒序浏览
你这属于水贴吧
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马