【发布时间】:2010-08-31 07:46:01
【问题描述】:
我正在将所有字符读入流中。我正在使用 inputStream.read 阅读它。这是 java.io.Reader 输入流。 读入缓冲区时如何忽略 @ 等特殊字符。
代码
private final void FillBuff() throws java.io.IOException
{
int i;
if (maxNextCharInd == 4096)
maxNextCharInd = nextCharInd = 0;
try {
if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
4096 - maxNextCharInd)) == -1)
{
inputStream.close();
throw new java.io.IOException();
}
else
maxNextCharInd += i;
return;
}
catch(java.io.IOException e) {
if (bufpos != 0)
{
--bufpos;
backup(0);
}
else
{
bufline[bufpos] = line;
bufcolumn[bufpos] = column;
}
throw e;
}
}
【问题讨论】:
标签: java