Package org.mortbay.io.nio

Examples of org.mortbay.io.nio.DirectNIOBuffer


            Resource resource=content.getResource();
            long length=resource.length();

            if (_useFileMappedBuffer && resource.getFile()!=null)
            {   
                buffer = new DirectNIOBuffer(resource.getFile());
            }
            else
            {
                InputStream is = resource.getInputStream();
                try
                {
                    Connector connector = HttpConnection.getCurrentConnection().getConnector();
                    buffer = ((NIOConnector)connector).getUseDirectBuffers()?
                            (NIOBuffer)new DirectNIOBuffer((int)length):
                            (NIOBuffer)new IndirectNIOBuffer((int)length);
                               
                }
                catch(OutOfMemoryError e)
                {
View Full Code Here

TOP

Related Classes of org.mortbay.io.nio.DirectNIOBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.