Memory mapped classpath HttpServlet
Possible improvement:

return directBuffer;


with:

return directBuffer.asReadOnlyBuffer();


Wanted to find a one-liner to help https://code.google.com/p/guava-libraries/wiki/IOExplained but ByteBuffer, streams nontrivial. Notice defining mutable ByteBuffer references in the method, placing each into an instance collection, one never flushed or refreshed...Servlet web container would need a restart in order to reflect changes to the files or other resources.