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