while語句中進行寫操作時,c是int型,為什么不用進行類型轉換?
while語句中進行寫操作時,c是int型,為什么不用進行類型轉換?
int?c?; while((c?=?in.read())!=-1){ out.write(c); out.flush(); } in.close(); out.close();
while語句中進行寫操作時,c是int型,為什么不用進行類型轉換?
int?c?; while((c?=?in.read())!=-1){ out.write(c); out.flush(); } in.close(); out.close();
2014-11-27
舉報
2016-02-16
http://www.xianlaiwan.cn/qadetail/118057
read()返回的不是字節數量,是字節值,看API,誤人子弟啊
2016-02-16
他為什么要寫入字節數啊,write()方法寫入的不是數據嗎?
2015-07-07
Returns:
the next byte of data, or -1 if the end of the? file is reached.
//這是in.read方法返回值介紹,不是數據下個字節嗎,為什么是讀取到的字節數?
2014-11-27
因為 in.read()的返回值 就是int
2014-11-27
read()返回的是讀取的字節數,write()是寫入文件的字節數,需要的就是c是int型,你想怎么變
2014-11-27
你想轉換成什么類型