Code example for ByteBuffer

Methods: clear

0
 
    public void free(ByteBuffer free) {
        final ReentrantLock myLock = lock;
        myLock.lock();
        try { 
            if (!pool.offer(free)) {
                discarded++;
            } else { 
                free.clear();
                pooled++;
            } 
        } finally { 
            myLock.unlock();
        } 
    } 
 
    /** 
     * @return the bytesAllocated 
     */ 
    public int getBytesAllocated() { 
        return bytesAllocated;