本文整理汇总了Java中java.nio.LongBuffer.position方法的典型用法代码示例。如果您正苦于以下问题:Java LongBuffer.position方法的具体用法?Java LongBuffer.position怎么用?Java LongBuffer.position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.nio.LongBuffer
的用法示例。
在下文中一共展示了LongBuffer.position方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCompressedCounts
import java.nio.LongBuffer; //导入方法依赖的package包/类
@Override
public long[] getCompressedCounts() {
LongBuffer buf = LongBuffer.allocate(200);
Simple64.compress(buf, counts, 0, counts.length);
long[] r = new long[buf.position()];
buf.flip();
buf.get(r);
return r;
}
示例2: getCompressedCounts
import java.nio.LongBuffer; //导入方法依赖的package包/类
@Override
public long[] getCompressedCounts() {
LongBuffer buf = LongBuffer.allocate(counts.length);
Simple64.compress(buf, counts, 0, counts.length);
long[] r = new long[buf.position()];
buf.flip();
buf.get(r);
return r;
}
示例3: copy
import java.nio.LongBuffer; //导入方法依赖的package包/类
public static void copy(LongBuffer src, LongBuffer dst) {
if (dst != null && !dst.isDirect()) {
int saved_position = dst.position();
dst.put(src);
dst.position(saved_position);
}
}
示例4: doWrap
import java.nio.LongBuffer; //导入方法依赖的package包/类
private static LongBuffer doWrap(LongBuffer buffer) {
LongBuffer direct_buffer = lookupBuffer(buffer);
direct_buffer.clear();
int saved_position = buffer.position();
direct_buffer.put(buffer);
buffer.position(saved_position);
direct_buffer.flip();
return direct_buffer;
}
示例5: skip_LongBuffer
import java.nio.LongBuffer; //导入方法依赖的package包/类
@Benchmark
public void skip_LongBuffer() {
LongBuffer longBuffer = _byteBuffer.asLongBuffer();
for (int i = 0; i < _byteBuffer.capacity() / 8; i++) {
if (shouldSkip(i)) {
longBuffer.position(longBuffer.position() + 1);
} else {
long value = longBuffer.get();
assertThat(value).isEqualTo(i);
}
}
_byteBuffer.rewind();
}
示例6: doNoCopyWrap
import java.nio.LongBuffer; //导入方法依赖的package包/类
private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
LongBuffer direct_buffer = lookupBuffer(buffer);
direct_buffer.limit(buffer.limit());
direct_buffer.position(buffer.position());
return direct_buffer;
}