国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

IO流_FileOutputStream的三個write()方法

2019-11-10 23:27:59
字體:
來源:轉載
供稿:網友
package cn.itcast_01;import java.io.FileOutputStream;import java.io.IOException;/* * 字節輸出流操作步驟: * 		A:創建字節輸出流對象 * 		B:調用write()方法 * 		C:釋放資源 *  * public void write(int b):寫一個字節 * public void write(byte[] b):寫一個字節數組 * public void write(byte[] b,int off,int len):寫一個字節數組的一部分 */public class FileOutputStreamDemo2 {	public static void main(String[] args) throws IOException {		// 創建字節輸出流對象		// OutputStream os = new FileOutputStream("fos2.txt");// 多態		FileOutputStream fos = new FileOutputStream("fos2.txt");		//調用write()方法		// public void write(int b):寫一個字節		// fos.write(97);		// public void write(byte[] b):寫一個字節數組		byte[] bytes = { 97, 98, 99, 100, 101 };		fos.write(bytes);		// public void write(byte[] b,int off,int len):寫一個字節數組的一部分		fos.write(bytes, 1, 3);// abcdebcd		fos.close();	}}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 深圳市| 元氏县| 湖口县| 边坝县| 甘泉县| 高唐县| 乌拉特前旗| 福贡县| 凤冈县| 广西| 怀来县| 区。| 英超| 弥渡县| 云南省| 瑞昌市| 阿勒泰市| 黄石市| 西乌珠穆沁旗| 雷山县| 梁河县| 和龙市| 垦利县| 青铜峡市| 龙里县| 开江县| 灵台县| 中卫市| 红河县| 开封市| 满城县| 西乡县| 东至县| 格尔木市| 竹溪县| 雷州市| 保康县| 文成县| 北宁市| 兰州市| 从江县|