protected Buffer getDirectBuffer(Resource resource)
{
try
{
if (_useFileMappedBuffer && resource.getFile()!=null)
return new DirectNIOBuffer(resource.getFile());
int len=(int)resource.length();
if (len<0)
{
LOG.warn("invalid resource: "+String.valueOf(resource)+" "+len);
return null;
}
Buffer buffer = new DirectNIOBuffer(len);
InputStream is = resource.getInputStream();
buffer.readFrom(is,len);
is.close();
return buffer;
}
catch(IOException e)
{