If I have a file with many protocol buffers messages saved in one after each other, how do I read that file back to a collection in Java?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How did you delimit the protobuf messages?
If you just wrote them one after the other, without using
writeDelimitedToyou can’t read them back, it’s just not a format that protocol buffers support.If you did use
writeDelimitedTo, I think you can figure out the corresponding parse method.