Code example for ByteBuffer

Methods: ByteBuffer.limit, duplicate, limit, position, slice

0
        dst.put(src);
    } 
 
    public int getContent(int offset, ByteBuffer dst)
    { 
        ByteBuffer src = _content.duplicate();
        src.position(offset);
        src = src.slice();
        if(dst.remaining() < src.limit())
        { 
            src.limit(dst.remaining());
        } 
        dst.put(src);
        return src.limit();
    } 
 
    public TransactionLog.StoreFuture flushToStore() 
    { 
        return MessageStore.IMMEDIATE_FUTURE; 
    }