val人员= Person()
person.mergeFrom(新的FileInputStream(“ path_of_file”))
错误:类型不匹配,预期:CodedInputStream,实际:FileInputStream
答案 0 :(得分:1)
您必须提供一个CodedInputStream。
更改:
persons.mergeFrom(new FileInputStream("path_of_file"))
收件人:
persons.mergeFrom(CodedInputStream.newInstance(new FileInputStream("path_of_file")))