src/main/java/org/nustaq/offheap/BinaryQueue.java
public void add(ByteSource source, long sourceoff, long sourcelen) {
        if ( sourcelen >= remaining() ) {
            grow(sourcelen+1); //issue85
            add(source,sourceoff,sourcelen);
            return;
        }
        for ( int i=0; i < sourcelen; i++ ) {
            storage.put(addIndex++,source.get(i+sourceoff));
            if ( addIndex >= storage.length() )
                addIndex -= storage.length();
        }
    }
public void add(ByteSource source, long sourceoff, long sourcelen) {
        if ( sourcelen >= remaining() ) {
            grow(sourcelen+1); //issue85
            add(source,sourceoff,sourcelen);
            return;
        }
        for ( int i=0; i < sourcelen; i++ ) {
            storage.put(addIndex++,source.get(i+sourceoff));
            if ( addIndex >= storage.length() )
                addIndex -= storage.length();
        }
    }
public void add ( ByteSource source , long sourceoff , long sourcelen ) { if ( sourcelen >= remaining ( ) ) { grow ( sourcelen + 1 ) ; //issue85 add ( source , sourceoff , sourcelen ) ; return ; } for ( int i = 0 ; i < sourcelen ; i ++ ) { storage . put ( addIndex ++ , source . get ( i + sourceoff ) ) ; if ( addIndex >= storage . length ( ) ) addIndex -= storage . length ( ) ; } }
add bytes to the queue. Again by using (reusable) Wrapper classes any kind of memory
(offheap, byte arrays, nio bytebuffer, memory mapped) can be added.

@param source
@param sourceoff
@param sourcelen
add bytes to the queue . Again by using ( reusable ) Wrapper classes any kind of memory ( offheap byte arrays nio bytebuffer memory mapped ) can be added .