public override void fillBufferFromCountsArray(/*final*/ ByteBuffer buffer, /*final*/ int length) { lock (updateLock) { if ((cachedDstLongBuffer == null) || (buffer != cachedDstByteBuffer) || (buffer.position() != cachedDstByteBufferPosition)) { cachedDstByteBuffer = buffer; cachedDstByteBufferPosition = buffer.position(); cachedDstLongBuffer = buffer.asLongBuffer(); } cachedDstLongBuffer.rewind(); cachedDstLongBuffer.put(counts, 0, length); } }
public override void fillBufferFromCountsArray(ByteBuffer buffer, int length) { lock (updateLock) { if ((cachedDstLongBuffer == null) || (buffer != cachedDstByteBuffer) || (buffer.position() != cachedDstByteBufferPosition)) { cachedDstByteBuffer = buffer; cachedDstByteBufferPosition = buffer.position(); cachedDstLongBuffer = buffer.asLongBuffer(); } cachedDstLongBuffer.rewind(); for (int i = 0; i < length; i++) { cachedDstLongBuffer.put(counts.get(i)); } } }