401150 close input stream used from cached resource

This commit is contained in:
Greg Wilkins 2013-03-15 16:00:40 +11:00
parent 8dc6aca9cd
commit d0f3db0f34
1 changed files with 7 additions and 9 deletions

View File

@ -112,16 +112,14 @@ public interface HttpContent
@Override
public ByteBuffer getIndirectBuffer()
{
try
if (_resource.length()<=0 || _maxBuffer<_resource.length())
return null;
int length=(int)_resource.length();
byte[] array = new byte[length];
int offset=0;
try (InputStream in=_resource.getInputStream())
{
if (_resource.length()<=0 || _maxBuffer<_resource.length())
return null;
int length=(int)_resource.length();
byte[] array = new byte[length];
int offset=0;
InputStream in=_resource.getInputStream();
do
{
int filled=in.read(array,offset,length);