读流怎样知道是否已经读完??(100分)

S

sunrain

Unregistered / Unconfirmed
GUEST, unregistred user!
用返回-1好象有问题。
 
什么意思??
 
不是可以得到流大小吗?什么意思?
 
不明白什么意思。
 
Positin=Length
 
不是有SIZE属性吗??
 
if astream.position=astream.size then
读完;
或者,把每次读的长度纪录下来,然后累加如果等于size
那么,读完.
 
aStream.Position = aStream.Siz - 1
hehe .
 
好象很多都没有啊,比如InputStream,BufferedInputSream
availbable 好象也没有返回结果。
 
InputReader ir = new InputReader(inputstream);
while((tmpStr=ir.readLine())!=null){
....
}
 
SuperMMX是对的
 
0是读完了,-1表示发生了错误
 
Stream's size is unrelyable. Use xx.readLine()==-1 sounds reasonable. If you think it is problem, just show the case.
BTW, maybe you are using pipe stream, something like these return -1 means NOW there is no data in the stream.
 
多人接受答案了。
 
顶部