I am new to protocol buffers, and I am trying to serialize a message
to a file. I need to serialize the file so that in can be opened in
Java using parseDelimitedFrom(). However, when I write to the file
using SerializeToCodedStream or SerializeWithCachedSizes, nothing
happens to the serializedMessage.bin file, and it stays at 0 bytes.
Why is nothing being written to the file? I have attached the code
int fd = open("serializedMessage.bin", O_WRONLY);
google::protobuf::io::ZeroCopyOutputStream* fileOutput = new
google::protobuf::io::CodedOutputStream* codedOutput = new
// also tried snap1.SerializeWithCachedSizes(codedOutput)
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at