本文整理汇总了Java中org.apache.avro.io.ResolvingDecoder.readInt方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvingDecoder.readInt方法的具体用法?Java ResolvingDecoder.readInt怎么用?Java ResolvingDecoder.readInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.avro.io.ResolvingDecoder
的用法示例。
在下文中一共展示了ResolvingDecoder.readInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readMap
import org.apache.avro.io.ResolvingDecoder; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Object readMap(Object old, Schema expected, ResolvingDecoder in)
throws IOException {
StatefulMap<Utf8, ?> map = (StatefulMap<Utf8, ?>) newMap(old, 0);
Map<Utf8, State> tempStates = null;
if (readDirtyBits) {
tempStates = new HashMap<Utf8, State>();
int size = in.readInt();
for (int j = 0; j < size; j++) {
Utf8 key = in.readString(null);
State state = State.values()[in.readInt()];
tempStates.put(key, state);
}
}
super.readMap(map, expected, in);
map.clearStates();
if (readDirtyBits) {
for (Entry<Utf8, State> entry : tempStates.entrySet()) {
map.putState(entry.getKey(), entry.getValue());
}
}
return map;
}