protected HttpEntity prepareDecoder(final HttpMessage message) throws HttpException {
BasicHttpEntity entity = new BasicHttpEntity();
long len = this.incomingContentStrategy.determineLength(message);
if (len == ContentLengthStrategy.CHUNKED) {
this.contentDecoder = new ChunkDecoder(this.session.channel(), this.inbuf);
entity.setChunked(true);
entity.setContentLength(-1);
} else if (len == ContentLengthStrategy.IDENTITY) {
this.contentDecoder = new IdentityDecoder(this.session.channel(), this.inbuf);
entity.setChunked(false);