Reputation: 93
val persons = Person()
persons.mergeFrom(new FileInputStream("path_of_file"))
Error : Type mismatch, expected: CodedInputStream, actual: FileInputStream
Upvotes: 0
Views: 203
Reputation: 183
You have to provide a CodedInputStream.
Change:
persons.mergeFrom(new FileInputStream("path_of_file"))
To:
persons.mergeFrom(CodedInputStream.newInstance(new FileInputStream("path_of_file")))
Upvotes: 1