예제 #1
0
 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);
     }
 }
예제 #2
0
 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));
         }
     }
 }