亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

IO流問題

IO流問題

AJohnson 2016-01-09 14:27:28
//創建 字節 數組 ?輸入流 String intput ="elephant";//輸入的字符串內容 byte[] buffer=intput.getBytes(); ByteArrayInputStream bais =new ByteArrayInputStream(buffer);//創建字節數組輸入對象 for(int i=0;i<intput.length();i++){ while(((int)bais.read())!=-1){ System.out.println((char)bais.read()); } }?輸出結果:lpat//創建 字節 數組 ?輸入流 String intput ="elephant";//輸入的字符串內容 byte[] buffer=intput.getBytes(); ByteArrayInputStream bais =new ByteArrayInputStream(buffer);//創建字節數組輸入對象 for(int i=0;i<intput.length();i++){? ? ? ? ? int c; while((c=bais.read())!=-1){ System.out.println((char)c); } }輸出結果:elephant為什么c=bais.read(),(char)c和(char)bais.read()的輸出結果會不一樣呢?求解答
查看完整描述

1 回答

  • 1 回答
  • 2 關注
  • 1409 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號