Examples of DirectNIOBuffer


Examples of org.mortbay.io.nio.DirectNIOBuffer

            {
                ByteBuffer byteBuffer=(ByteBuffer)value;
                synchronized (byteBuffer)
                {
                    NIOBuffer buffer = byteBuffer.isDirect()
                        ?(NIOBuffer)new DirectNIOBuffer(byteBuffer,true)
                        :(NIOBuffer)new IndirectNIOBuffer(byteBuffer,true);
                    ((HttpConnection.Output)getServletResponse().getOutputStream()).sendResponse(buffer);
                }
            }
            catch (IOException e)
View Full Code Here

Examples of org.mortbay.io.nio.DirectNIOBuffer

        Buffer buf = null;
        if (size==getHeaderBufferSize())
            buf= new IndirectNIOBuffer(size);
        else
            buf = _useDirectBuffers
                ?(NIOBuffer)new DirectNIOBuffer(size)
                :(NIOBuffer)new IndirectNIOBuffer(size);
        return buf;
    }
View Full Code Here

Examples of org.mortbay.io.nio.DirectNIOBuffer

    {
        super.setUp();
        buffer=new Buffer[]{
          new ByteArrayBuffer(10),
          new IndirectNIOBuffer(10),
          new DirectNIOBuffer(10)
        };
    }
View Full Code Here

Examples of org.mortbay.io.nio.DirectNIOBuffer

    {
        Buffer[] b=
        {
                new ByteArrayBuffer("Test1234 "),
                new ByteArrayBuffer("tEST1234 "),
                new DirectNIOBuffer(4096),
        };
        b[2].put("TeSt1234 ".getBytes(StringUtil.__UTF8));
       
        for (int i=0;i<b.length;i++)
            assertEquals("t"+i,b[0].hashCode(),b[i].hashCode());
View Full Code Here

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

Examples of org.mortbay.io.nio.DirectNIOBuffer

            {
                ByteBuffer byteBuffer=(ByteBuffer)value;
                synchronized (byteBuffer)
                {
                    NIOBuffer buffer = byteBuffer.isDirect()
                        ?(NIOBuffer)new DirectNIOBuffer(byteBuffer,true)
                        :(NIOBuffer)new IndirectNIOBuffer(byteBuffer,true);
                    ((HttpConnection.Output)getServletResponse().getOutputStream()).sendResponse(buffer);
                }
            }
            catch (IOException e)
View Full Code Here

Examples of org.mortbay.io.nio.DirectNIOBuffer

            if (_useFileMappedBuffer && resource.getFile()!=null)
            {   
                File file = resource.getFile();
                if (file != null)
                    buffer = new DirectNIOBuffer(file);
            }
            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

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

Examples of org.mortbay.io.nio.DirectNIOBuffer

            {
                ByteBuffer byteBuffer=(ByteBuffer)value;
                synchronized (byteBuffer)
                {
                    NIOBuffer buffer = byteBuffer.isDirect()
                        ?(NIOBuffer)new DirectNIOBuffer(byteBuffer,true)
                        :(NIOBuffer)new IndirectNIOBuffer(byteBuffer,true);
                    ((HttpConnection.Output)getServletResponse().getOutputStream()).sendResponse(buffer);
                }
            }
            catch (IOException e)
View Full Code Here

Examples of org.mortbay.io.nio.DirectNIOBuffer

            {
                ByteBuffer byteBuffer=(ByteBuffer)value;
                synchronized (byteBuffer)
                {
                    NIOBuffer buffer = byteBuffer.isDirect()
                        ?(NIOBuffer)new DirectNIOBuffer(byteBuffer,true)
                        :(NIOBuffer)new IndirectNIOBuffer(byteBuffer,true);
                    ((HttpConnection.Output)getServletResponse().getOutputStream()).sendResponse(buffer);
                }
            }
            catch (IOException e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.