读书人

帮小弟我看看如何改

发布时间: 2013-04-20 19:43:01 作者: rapoo

帮我看看怎么改?
while(flage!=-1)
{
flage=reader.read(bt);
System.out.println(new String(bt)+flage);
}
文件内容:
Hello word!
hello word!
为什么输出内容是这样?
Hello word!11

hello wor11
d!hello wor2
d!hello wor-1

[解决办法]
System.out.println(new String(bt,0,flage)+flage);
[解决办法]
while(flage==11)
{
flage=reader.read(bt);
for(int i=0;i<flage;i++)
System.out.print(bt[i]);
}

读书人网 >J2SE开发

热点推荐