}
int contentLength = getRequestContentLength();
if ((contentLength == CONTENT_LENGTH_CHUNKED) && !isHttp11()) {
throw new HttpException(
"Chunked transfer encoding not allowed for HTTP/1.0");
}
InputStream instream = null;
if (this.requestStream != null) {
LOG.debug("Using unbuffered request body");
instream = this.requestStream;
} else {
if (this.contentCache == null) {
this.contentCache = generateRequestBody();
}
if (this.contentCache != null) {
LOG.debug("Using buffered request body");
instream = new ByteArrayInputStream(this.contentCache);
}
}
if (instream == null) {
LOG.debug("Request body is empty");
return true;
}
if ((this.repeatCount > 0) && (this.contentCache == null)) {
throw new HttpException(
"Unbuffered entity enclosing request can not be repeated.");
}
this.repeatCount++;