#8285 - handle review comments

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2022-07-26 10:42:59 +02:00
parent 38d22f3153
commit 32ef1616e6
1 changed files with 2 additions and 6 deletions

View File

@ -204,13 +204,9 @@ public class CachingContentFactory implements HttpContent.ContentFactory
super(httpContent);
_etag = precalculatedEtag;
_contentLengthValue = httpContent.getContentLengthValue(); // TODO getContentLengthValue() could return -1
ByteBuffer byteBuffer = null;
if (_useFileMappedBuffer)
{
// map the content into memory
byteBuffer = BufferUtil.toMappedBuffer(httpContent.getResource(), 0, _contentLengthValue);
}
// map the content into memory if possible
ByteBuffer byteBuffer = _useFileMappedBuffer ? BufferUtil.toMappedBuffer(httpContent.getResource(), 0, _contentLengthValue) : null;
if (byteBuffer == null)
{