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

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

IO流_BufferedInputStream讀取數(shù)據(jù)

2019-11-10 17:08:48
字體:
供稿:網(wǎng)友
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"));		// // 讀取數(shù)據(jù)		// 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();	}}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 米脂县| 边坝县| 云林县| 呈贡县| 东乡族自治县| 通道| 磴口县| 宜春市| 神池县| 丰台区| 平乐县| 邳州市| 阿勒泰市| 邓州市| 合水县| 仙居县| 桂平市| 高邑县| 盘山县| 普陀区| 茌平县| 汝阳县| 濉溪县| 睢宁县| 清河县| 临泽县| 东兰县| 大余县| 湟中县| 深州市| 邛崃市| 汝阳县| 虹口区| 白朗县| 西平县| 昌宁县| 绥阳县| 改则县| 钦州市| 土默特左旗| 沭阳县|