Thanks Evan, I'll give this a try. I have actually got the code working, but it involves creating a new output stream everytime I write to it (surely got to be wasteful and not the right way?).
Nigel On May 13, 11:50 am, Evan Jones <ev...@mit.edu> wrote: > On May 13, 2011, at 10:12 , Nigel Pickard wrote: > > > "libprotobuf FATAL google/protobuf/io/zero_copy_stream_impl_lite.cc: > > 346] CHECK failed: (buffer_used_) == (buffer_size_): BackUp() can > > only be called after Next()." > > Off the top of my head, I *believe* this is happening because the > CodedOutputStream destructor is trying to reposition the > FileOutputStream, but the FileOutputStream has already been closed. In > this case, you either want to put the CodedOutputStream into its own > enclosing scope, to force the destructor to run before you close the > FileOutputStream, or just let the FileOutputStream destructor flush > and close the file automatically. > > I hope this helps, > > Evan > > --http://evanjones.ca/ -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.