gpt4 book ai didi

com.netflix.hollow.core.memory.encoding.ZigZag.decodeLong()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:13:25 26 4
gpt4 key购买 nike

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

ZigZag.decodeLong介绍

暂无

代码示例

代码示例来源:origin: Netflix/hollow

public long readLong(int ordinal, int fieldIndex) {
  HollowObjectTypeDataElements currentData;
  long value;
  do {
    currentData = this.currentDataVolatile;
    long bitOffset = fieldOffset(currentData, ordinal, fieldIndex);
    int numBitsForField = currentData.bitsPerField[fieldIndex];
    value = currentData.fixedLengthData.getLargeElementValue(bitOffset, numBitsForField);
  } while(readWasUnsafe(currentData));
  if(value == currentData.nullValueForField[fieldIndex])
    return Long.MIN_VALUE;
  return ZigZag.decodeLong(value);
}

代码示例来源:origin: Netflix/hollow

return ZigZag.decodeInt(VarInt.readVInt(data, location));
case LONG:
  return ZigZag.decodeLong(VarInt.readVLong(data, location));
case DOUBLE:
  long longBits = data.readLongBits(location);

代码示例来源:origin: Netflix/hollow

currentRecordPointer += VarInt.sizeOfVLong(lvalue);
if(rec != null)
  rec.setLong(fieldName, ZigZag.decodeLong(lvalue));

代码示例来源:origin: Netflix/hollow

return 0;
  long longVal = VarInt.readVLong(data, offset);
  longVal = ZigZag.decodeLong(longVal);
  return (int)(longVal ^ (longVal >>> 32));
case REFERENCE:

代码示例来源:origin: Netflix/hollow

@Test
public void translatesSchemas() {
  HollowObjectWriteRecord rec = new HollowObjectWriteRecord(schema);
  rec.setInt("FieldA", 1023);
  rec.setLong("FieldB", 123556);
  rec.setBoolean("FieldC", true);
  HollowObjectSchema translatedSchema = new HollowObjectSchema("Test", 3);
  translatedSchema.addField("FieldB", FieldType.LONG);
  translatedSchema.addField("FieldD", FieldType.STRING);
  translatedSchema.addField("FieldA", FieldType.INT);
  ByteDataBuffer buf = new ByteDataBuffer(WastefulRecycler.DEFAULT_INSTANCE);
  rec.writeDataTo(buf, translatedSchema);
  long field0 = VarInt.readVLong(buf.getUnderlyingArray(), 0);
  int field0Length = VarInt.sizeOfVLong(field0);
  int field2 = VarInt.readVInt(buf.getUnderlyingArray(), field0Length + 1);
  Assert.assertEquals(123556, ZigZag.decodeLong(field0));
  Assert.assertTrue(VarInt.readVNull(buf.getUnderlyingArray(), field0Length));
  Assert.assertEquals(1023, ZigZag.decodeInt(field2));
}

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