Methods Summary |
---|
void | clear()Clear facade.
ib = null;
|
protected java.lang.Object | clone()Prevent cloning the facade.
throw new CloneNotSupportedException();
|
public void | close()
ib.close();
|
public void | mark(int readAheadLimit)
ib.mark(readAheadLimit);
|
public boolean | markSupported()
return true;
|
public int | read()
return ib.read();
|
public int | read(char[] cbuf)
return ib.read(cbuf, 0, cbuf.length);
|
public int | read(char[] cbuf, int off, int len)
return ib.read(cbuf, off, len);
|
public java.lang.String | readLine()
if (lineBuffer == null) {
lineBuffer = new char[MAX_LINE_LENGTH];
}
String result = null;
int pos = 0;
int end = -1;
int skip = -1;
StringBuffer aggregator = null;
while (end < 0) {
mark(MAX_LINE_LENGTH);
while ((pos < MAX_LINE_LENGTH) && (end < 0)) {
int nRead = read(lineBuffer, pos, MAX_LINE_LENGTH - pos);
if (nRead < 0) {
if (pos == 0) {
return null;
}
end = pos;
skip = pos;
}
for (int i = pos; (i < (pos + nRead)) && (end < 0); i++) {
if (lineBuffer[i] == LINE_SEP[0]) {
end = i;
skip = i + 1;
char nextchar;
if (i == (pos + nRead - 1)) {
nextchar = (char) read();
} else {
nextchar = lineBuffer[i+1];
}
if (nextchar == LINE_SEP[1]) {
skip++;
}
} else if (lineBuffer[i] == LINE_SEP[1]) {
end = i;
skip = i + 1;
}
}
if (nRead > 0) {
pos += nRead;
}
}
if (end < 0) {
if (aggregator == null) {
aggregator = new StringBuffer();
}
aggregator.append(lineBuffer);
pos = 0;
} else {
reset();
skip(skip);
}
}
if (aggregator == null) {
result = new String(lineBuffer, 0, end);
} else {
aggregator.append(lineBuffer, 0, end);
result = aggregator.toString();
}
return result;
|
public boolean | ready()
return ib.ready();
|
public void | reset()
ib.reset();
|
public long | skip(long n)
return ib.skip(n);
|