Exemplo n.º 1
0
        protected CompoundVecBuffer(CompoundVecBuffer that, int[] indices, int offset, int length)
        {
            this.count    = length;
            this.capacity = length;

            this.offsets = WWBufferUtil.newIntBuffer(length, ALLOCATE_DIRECT_BUFFERS);
            this.lengths = WWBufferUtil.newIntBuffer(length, ALLOCATE_DIRECT_BUFFERS);

            for (int i = offset; i < offset + length; i++)
            {
                this.offsets.put(that.offsets.get(indices[i]));
                this.lengths.put(that.lengths.get(indices[i]));
            }

            this.offsets.rewind();
            this.lengths.rewind();
        }
Exemplo n.º 2
0
        protected CompoundVecBuffer(CompoundVecBuffer that, int beginIndex, int endIndex)
        {
            int length = endIndex - beginIndex + 1;

            this.count    = length;
            this.capacity = length;

            this.offsets = WWBufferUtil.newIntBuffer(length, ALLOCATE_DIRECT_BUFFERS);
            that.offsets.limit(endIndex + 1);
            that.offsets.position(beginIndex);
            this.offsets.put(that.offsets);
            this.offsets.rewind();
            that.offsets.clear();

            this.lengths = WWBufferUtil.newIntBuffer(length, ALLOCATE_DIRECT_BUFFERS);
            that.lengths.limit(endIndex + 1);
            that.lengths.position(beginIndex);
            this.lengths.put(that.lengths);
            this.lengths.rewind();
            that.lengths.clear();
        }