gpt4 book ai didi

com.yahoo.memory.WritableMemory.getArray()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 21:19:05 33 4
gpt4 key购买 nike

本文整理了Java中com.yahoo.memory.WritableMemory.getArray()方法的一些代码示例,展示了WritableMemory.getArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableMemory.getArray()方法的具体详情如下:
包路径:com.yahoo.memory.WritableMemory
类名称:WritableMemory
方法名:getArray

WritableMemory.getArray介绍

[英]Returns the primitive backing array, otherwise null.
[中]返回基元支持数组,否则为null。

代码示例

代码示例来源:origin: DataSketches/sketches-core

final void updateMemory(final WritableMemory newWmem) {
 wmem = newWmem;
 mem = newWmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
}

代码示例来源:origin: DataSketches/sketches-core

DirectHllArray(final int lgConfigK, final TgtHllType tgtHllType, final WritableMemory wmem) {
 super(lgConfigK, tgtHllType, CurMode.HLL);
 this.wmem = wmem;
 mem = wmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
 assert !compact;
}

代码示例来源:origin: DataSketches/sketches-core

DirectHllArray(final int lgConfigK, final TgtHllType tgtHllType, final Memory mem) {
 super(lgConfigK, tgtHllType, CurMode.HLL);
 wmem = null;
 this.mem = mem;
 memObj = ((WritableMemory) mem).getArray();
 memAdd = mem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
}

代码示例来源:origin: DataSketches/sketches-core

DirectCouponList(final int lgConfigK, final TgtHllType tgtHllType, final CurMode curMode,
  final WritableMemory wmem) {
 super(lgConfigK, tgtHllType, curMode);
 this.wmem = wmem;
 mem = wmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
 compact = extractCompactFlag(wmem);
 assert !compact;
}

代码示例来源:origin: DataSketches/sketches-core

DirectCouponList(final int lgConfigK, final TgtHllType tgtHllType, final CurMode curMode,
  final Memory mem) {
 super(lgConfigK, tgtHllType, curMode);
 wmem = null;
 this.mem = mem;
 memObj = ((WritableMemory) mem).getArray();
 memAdd = mem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
}

代码示例来源:origin: DataSketches/sketches-core

/**
 * Return this sketch as a compressed byte array.
 * @return this sketch as a compressed byte array.
 */
public byte[] toByteArray() {
 final CompressedState state = CompressedState.compress(this);
 final long cap = state.getRequiredSerializedBytes();
 final WritableMemory wmem = WritableMemory.allocate((int) cap);
 state.exportToMemory(wmem);
 return (byte[]) wmem.getArray();
}

代码示例来源:origin: DataSketches/sketches-core

return emptyOrNull(seed, hashOut);
final Object uObj = ((WritableMemory) mem).getArray(); //may be null
long cumOff = mem.getCumulativeOffset() + offsetBytes;

代码示例来源:origin: DataSketches/sketches-core

@SuppressWarnings("unused")
@Test
public void checkExtractFlags() {
 int bytes = HllSketch.getMaxUpdatableSerializationBytes(4, TgtHllType.HLL_4);
 WritableMemory wmem = WritableMemory.allocate(bytes);
 Object memObj = wmem.getArray();
 long memAdd = wmem.getCumulativeOffset(0L);
 HllSketch sk = new HllSketch(4, TgtHllType.HLL_4, wmem);
 int flags = extractFlags(wmem);
 assertEquals(flags, EMPTY_FLAG_MASK);
}

代码示例来源:origin: com.yahoo.datasketches/sketches-core

DirectCompactSketch(final Memory mem) {
 mem_ = mem;
 memObj_ = ((WritableMemory)mem).getArray();
 memAdd_ = mem.getCumulativeOffset(0L);
}

代码示例来源:origin: com.yahoo.datasketches/sketches-core

final void updateMemory(final WritableMemory newWmem) {
 wmem = newWmem;
 mem = newWmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
}

代码示例来源:origin: DataSketches/sketches-core

println(CpcSketch.toString((byte[])wmem.getArray(), true));
checkFirst8(wmem, format, lgK, (byte) 0);
assertFalse(hasHip(wmem));

代码示例来源:origin: com.yahoo.datasketches/sketches-core

DirectCouponList(final int lgConfigK, final TgtHllType tgtHllType, final CurMode curMode,
  final Memory mem) {
 super(lgConfigK, tgtHllType, curMode);
 wmem = null;
 this.mem = mem;
 memObj = ((WritableMemory) mem).getArray();
 memAdd = mem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
}

代码示例来源:origin: com.yahoo.datasketches/sketches-core

DirectCouponList(final int lgConfigK, final TgtHllType tgtHllType, final CurMode curMode,
  final WritableMemory wmem) {
 super(lgConfigK, tgtHllType, curMode);
 this.wmem = wmem;
 mem = wmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
 compact = extractCompactFlag(wmem);
 assert !compact;
}

代码示例来源:origin: com.yahoo.datasketches/sketches-core

DirectHllArray(final int lgConfigK, final TgtHllType tgtHllType, final WritableMemory wmem) {
 super(lgConfigK, tgtHllType, CurMode.HLL);
 this.wmem = wmem;
 mem = wmem;
 memObj = wmem.getArray();
 memAdd = wmem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
 assert !compact;
}

代码示例来源:origin: com.yahoo.datasketches/sketches-core

DirectHllArray(final int lgConfigK, final TgtHllType tgtHllType, final Memory mem) {
 super(lgConfigK, tgtHllType, CurMode.HLL);
 wmem = null;
 this.mem = mem;
 memObj = ((WritableMemory) mem).getArray();
 memAdd = mem.getCumulativeOffset(0L);
 compact = extractCompactFlag(mem);
}

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com