当前位置: 技术问答>java相关
请教一个问题,简单的,会的来领分,在线等待,搞定后马上结帖!
来源: 互联网 发布时间:2015-06-03
本文导语: 我想请问下面的一个程序是通过什么方法运行了类RemoveHTMLReader中的read(char[] buf,int from,int len)这个方法的?谁能给解释一下,谢谢!! import java.io.*; public class RemoveHTMLReader extends FilterReader { public RemoveHTMLRead...
我想请问下面的一个程序是通过什么方法运行了类RemoveHTMLReader中的read(char[] buf,int from,int len)这个方法的?谁能给解释一下,谢谢!!
import java.io.*;
public class RemoveHTMLReader extends FilterReader {
public RemoveHTMLReader(Reader in) { super(in); }
boolean intag=false;
public int read(char[] buf,int from,int len) throws IOException {
int numchars=0;
while(numchars==0) {
numchars=in.read(buf,from,len);
if(numchars==-1) return -1;
int last=from;
for(int i=from;i 0) {
nChars = dst + n;
nextChar = dst;
}
2.
String readLine(boolean ignoreLF) throws IOException {
StringBuffer s = null;
int startChar;
boolean omitLF = ignoreLF || skipLF;
synchronized (lock) {
ensureOpen();
bufferLoop:
for (;;) {
if (nextChar >= nChars)
fill();
if (nextChar >= nChars) { /* EOF */
if (s != null && s.length() > 0)
return s.toString();
else
return null;
}
boolean eol = false;
char c = 0;
int i;
/* Skip a leftover 'n', if necessary */
if (omitLF && (cb[nextChar] == 'n'))
nextChar++;
skipLF = false;
omitLF = false;
charLoop:
for (i = nextChar; i
import java.io.*;
public class RemoveHTMLReader extends FilterReader {
public RemoveHTMLReader(Reader in) { super(in); }
boolean intag=false;
public int read(char[] buf,int from,int len) throws IOException {
int numchars=0;
while(numchars==0) {
numchars=in.read(buf,from,len);
if(numchars==-1) return -1;
int last=from;
for(int i=from;i 0) {
nChars = dst + n;
nextChar = dst;
}
2.
String readLine(boolean ignoreLF) throws IOException {
StringBuffer s = null;
int startChar;
boolean omitLF = ignoreLF || skipLF;
synchronized (lock) {
ensureOpen();
bufferLoop:
for (;;) {
if (nextChar >= nChars)
fill();
if (nextChar >= nChars) { /* EOF */
if (s != null && s.length() > 0)
return s.toString();
else
return null;
}
boolean eol = false;
char c = 0;
int i;
/* Skip a leftover 'n', if necessary */
if (omitLF && (cb[nextChar] == 'n'))
nextChar++;
skipLF = false;
omitLF = false;
charLoop:
for (i = nextChar; i