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

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

IO流_BufferedInputStream讀取數據

2019-11-10 17:44:49
字體:
來源:轉載
供稿:網友
package cn.itcast_05;import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.IOException;/* * 注意:雖然我們有兩種方式可以讀取,但是,請注意,這兩種方式針對同一個對象在一個代碼中只能使用一個。 */public class BufferedInputStreamDemo {	public static void main(String[] args) throws IOException {		// BufferedInputStream(InputStream in)		BufferedInputStream bis = new BufferedInputStream(new FileInputStream(				"bos.txt"));		// // 讀取數據		// int len = 0;		// while ((len = bis.read()) != -1) {		// System.out.PRint((char) len);		// }		// System.out.println("----------------");		byte[] bys = new byte[1024];		int len = 0;		while ((len = bis.read(bys)) != -1) {			System.out.println(new String(bys, 0, len));		}		// 釋放資源		bis.close();	}}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌拉特前旗| 岳阳市| 昌宁县| 凤庆县| 昭苏县| 共和县| 任丘市| 远安县| 灵丘县| 龙川县| 德安县| 静宁县| 海口市| 陈巴尔虎旗| 林西县| 监利县| 孝义市| 西充县| 翼城县| 黔西县| 吴江市| 马关县| 冀州市| 丽水市| 洞口县| 永寿县| 偏关县| 朝阳市| 新建县| 汝州市| 台安县| 阿克苏市| 益阳市| 静宁县| 曲靖市| 会理县| 汽车| 塘沽区| 喀喇沁旗| 尉氏县| 阿拉善右旗|