@Override protected void onEntityEnclosed(HttpEntity entity, ContentType contentType) throws IOException { long len = entity.getContentLength(); if (len > bufferLimitBytes) { throw new ContentTooLongException("entity content is too long [" + len + "] for the configured buffer limit [" + bufferLimitBytes + "]"); } if (len < 0) { len = 4096; } this.buf = new SimpleInputBuffer((int) len, getByteBufferAllocator()); this.response.setEntity(new ContentBufferEntity(entity, this.buf)); }
@Override protected void onEntityEnclosed(final HttpEntity entity, final ContentType contentType) throws IOException { long len = entity.getContentLength(); if (len > Integer.MAX_VALUE) { throw new ContentTooLongException("Entity content is too long: " + len); } if (len < 0) { len = BUFFER_SIZE; } this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator()); this.httpResponse.setEntity(new ContentBufferEntity(entity, this.buf)); }
@Override protected void onEntityEnclosed(final HttpEntity entity, final ContentType contentType) throws IOException { long len = entity.getContentLength(); if (len > Integer.MAX_VALUE) { throw new ContentTooLongException("Entity content is too long: " + len); } if (len < 0) { len = 4096; } this.buf = new SimpleInputBuffer((int) len, new HeapByteBufferAllocator()); this.response.setEntity(new ContentBufferEntity(entity, this.buf)); }