Code example for ConcurrentLinkedQueue

Methods: poll

0
            if (buffer==null)
                buffer=new IndirectNIOBuffer(size); 
        } 
        else if (size==_packetBufferSize)
        {    
            buffer = _packetBuffers.poll();
            if (buffer==null)
                buffer=getUseDirectBuffers()
                    ?(NIOBuffer)new DirectNIOBuffer(size)
                    :(NIOBuffer)new IndirectNIOBuffer(size);
        } 
        else  
            buffer=super.getBuffer(size);
         
        return buffer;
    } 
     
 
    /* ------------------------------------------------------------ */ 
    /* (non-Javadoc) 
     * @see org.mortbay.jetty.AbstractBuffers#returnBuffer(org.mortbay.io.Buffer)