在InputStreamReader如果判断文件已经读完,解决马上给分

dlxu 2004-09-09 07:17:52
读取文件的时候,如果判断文件已经读取完毕呢,解决马上给分
...全文
178 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fdm_sea 2004-09-09
  • 打赏
  • 举报
回复
public int read(char[] cbuf,
int offset,
int length)
throws IOExceptionRead characters into a portion of an array

Returns:
The number of characters read, or -1 if the end of the stream has been reached
dlxu 2004-09-09
  • 打赏
  • 举报
回复
也许是我没说清楚,我用的是inputstreamreader.read(char[])这种方式,怎么判断呢
TinyJimmy 2004-09-09
  • 打赏
  • 举报
回复
ready()=false
twenth 2004-09-09
  • 打赏
  • 举报
回复
int c;
while(c=inputstreamreader.read())!=-1)
{
....
}

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧