Methods Summary |
---|
public int | available()
return buffered.getLength();
|
public int | doRead(org.apache.tomcat.util.buf.ByteChunk chunk, org.apache.coyote.Request request)Fills the given ByteChunk with the buffered request body.
if (hasRead || buffered.getLength() <= 0) {
return -1;
} else {
chunk.setBytes(buffered.getBytes(), buffered.getStart(),
buffered.getLength());
hasRead = true;
}
return chunk.getLength();
|
public long | end()
return 0;
|
public org.apache.tomcat.util.buf.ByteChunk | getEncodingName()
return ENCODING;
|
public void | recycle()
if (buffered.getBuffer().length > 65536) {
buffered = null;
} else {
buffered.recycle();
}
tempRead.recycle();
hasRead = false;
buffer = null;
|
public void | setBuffer(org.apache.coyote.InputBuffer buffer)
this.buffer = buffer;
|
public void | setLimit(int limit)Set the buffering limit. This should be reset every time the buffer is
used.
// ----------------------------------------------------- Static Initializer
ENCODING.setBytes(ENCODING_NAME.getBytes(), 0, ENCODING_NAME.length());
if (buffered == null) {
buffered = new ByteChunk(4048);
buffered.setLimit(limit);
}
|
public void | setRequest(org.apache.coyote.Request request)Reads the request body and buffers it.
// save off the Request body
try {
while (buffer.doRead(tempRead, request) >= 0) {
buffered.append(tempRead);
tempRead.recycle();
}
} catch(IOException iex) {
// Ignore
}
|