vishal yadav
vishal yadav

Reputation: 93

Type mismatch, expected: CodedInputStream, actual: FileInputStream

val persons = Person()
persons.mergeFrom(new FileInputStream("path_of_file"))

Error : Type mismatch, expected: CodedInputStream, actual: FileInputStream

Upvotes: 0

Views: 203

Answers (1)

Alexandre Nascimento
Alexandre Nascimento

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

Related Questions