本文整理汇总了Java中com.intellij.util.io.KeyDescriptor.save方法的典型用法代码示例。如果您正苦于以下问题:Java KeyDescriptor.save方法的具体用法?Java KeyDescriptor.save怎么用?Java KeyDescriptor.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.io.KeyDescriptor
的用法示例。
在下文中一共展示了KeyDescriptor.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataExternalizer
import com.intellij.util.io.KeyDescriptor; //导入方法依赖的package包/类
public static DataExternalizer<CallingLocation> createDataExternalizer() {
final KeyDescriptor<MethodIncompleteSignature> methodIncompleteSignatureKeyDescriptor = MethodIncompleteSignature.createKeyDescriptor();
return new DataExternalizer<CallingLocation>() {
@Override
public void save(final DataOutput out, final CallingLocation value) throws IOException {
methodIncompleteSignatureKeyDescriptor.save(out, value.getMethodIncompleteSignature());
VariableType.KEY_DESCRIPTOR.save(out, value.getVariableType());
}
@Override
public CallingLocation read(final DataInput in) throws IOException {
return new CallingLocation(methodIncompleteSignatureKeyDescriptor.read(in), VariableType.KEY_DESCRIPTOR.read(in));
}
};
}
示例2: serializeIndexValue
import com.intellij.util.io.KeyDescriptor; //导入方法依赖的package包/类
public <K> void serializeIndexValue(DataOutput out, StubIndexKey<K, ?> stubIndexKey, Map<K, StubIdList> map) throws IOException {
MyIndex<K> index = (MyIndex<K>)getAsyncState().myIndices.get(stubIndexKey);
KeyDescriptor<K> keyDescriptor = index.getExtension().getKeyDescriptor();
DataInputOutputUtil.writeINT(out, map.size());
for(K key:map.keySet()) {
keyDescriptor.save(out, key);
StubIdExternalizer.INSTANCE.save(out, map.get(key));
}
}