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

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

IO流_BufferedInputStream讀取數據

2019-11-10 20:03:25
字體:
來源:轉載
供稿:網友
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();	}}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 富顺县| 新营市| 报价| 潞西市| 黄梅县| 上栗县| 桃园县| 土默特左旗| 综艺| 原阳县| 龙游县| 江北区| 井陉县| 浦城县| 丘北县| 岚皋县| 大城县| 许昌市| 毕节市| 义马市| 崇信县| 颍上县| 安吉县| 左云县| 梁河县| 奈曼旗| 东丽区| 英德市| 五台县| 临海市| 镇平县| 湛江市| 贡觉县| 白朗县| 紫阳县| 福泉市| 江达县| 邯郸市| 屯留县| 镇赉县| 正阳县|