本文整理了Java中com.netflix.hollow.core.memory.encoding.ZigZag.decodeInt()
方法的一些代码示例,展示了ZigZag.decodeInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigZag.decodeInt()
方法的具体详情如下:
包路径:com.netflix.hollow.core.memory.encoding.ZigZag
类名称:ZigZag
方法名:decodeInt
暂无
代码示例来源:origin: Netflix/hollow
public int readInt(int ordinal, int fieldIndex) {
HollowObjectTypeDataElements currentData;
long value;
do {
currentData = this.currentDataVolatile;
value = readFixedLengthFieldValue(currentData, ordinal, fieldIndex);
} while(readWasUnsafe(currentData));
if(value == currentData.nullValueForField[fieldIndex])
return Integer.MIN_VALUE;
return ZigZag.decodeInt((int)value);
}
代码示例来源:origin: Netflix/hollow
return data.get(location) == 1;
case INT:
return ZigZag.decodeInt(VarInt.readVInt(data, location));
case LONG:
return ZigZag.decodeLong(VarInt.readVLong(data, location));
代码示例来源:origin: Netflix/hollow
currentRecordPointer += VarInt.sizeOfVInt(ivalue);
if(rec != null)
rec.setInt(fieldName, ZigZag.decodeInt(ivalue));
代码示例来源:origin: Netflix/hollow
return 0;
int intVal = VarInt.readVInt(data, offset);
intVal = ZigZag.decodeInt(intVal);
return intVal;
case LONG:
代码示例来源: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));
}
内容来源于网络,如有侵权,请联系作者删除!