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

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

IO流_BufferedInputStream讀取數據

2019-11-10 17:30:19
字體:
來源:轉載
供稿:網友
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();	}}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宣武区| 麻栗坡县| 城口县| 买车| 昌乐县| 疏勒县| 互助| 卓尼县| 芷江| 龙岩市| 慈溪市| 南充市| 读书| 佳木斯市| 三亚市| 新源县| 巴林右旗| 麻城市| 田东县| 揭西县| 连平县| 永城市| 漯河市| 红安县| 台南县| 瓮安县| 固阳县| 桃江县| 乌兰浩特市| 招远市| 称多县| 明光市| 开江县| 类乌齐县| 福建省| 资兴市| 南通市| 娄烦县| 城市| 汝城县| 襄垣县|