Method from org.apache.catalina.connector.CoyoteReader Detail: |
void clear() {
ib = null;
}
|
protected Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
Prevent cloning the facade. |
public void close() throws IOException {
ib.close();
}
|
public void mark(int readAheadLimit) throws IOException {
ib.mark(readAheadLimit);
}
|
public boolean markSupported() {
return true;
}
|
public int read() throws IOException {
return ib.read();
}
|
public int read(char[] cbuf) throws IOException {
return ib.read(cbuf, 0, cbuf.length);
}
|
public int read(char[] cbuf,
int off,
int len) throws IOException {
return ib.read(cbuf, off, len);
}
|
public String readLine() throws IOException {
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 && aggregator == null) {
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() throws IOException {
return ib.ready();
}
|
public void reset() throws IOException {
ib.reset();
}
|
public long skip(long n) throws IOException {
return ib.skip(n);
}
|