On Sun, Jun 28, 2009 at 7:30 AM, Alex Black <a...@alexblack.ca> wrote:

>
> Hi, I'm trying to use these to serialize messages to my own stream.
>
> I have a couple of questions:
>
> 1. If I use message.SerializeToCodedStream() do I still need to write
> the size of the message to the stream on my own first?


Yes.


> 2. My new code looks like this:
>
> MyStream myStream; // this implements CopyingOutputStream
> CopyingOutputStreamAdaptor protoBufStream(&myStream);
> CodedOutputStream codedOutputStream(&protoBufStream);
>
> Then I write messages like this:
>
> message.SerializeToCodedStream(&codedOutputStream);
>
> When the CodedOutputStream's destructor gets called, my program aborts
> hard.. Looks like there is still 5192 bytes in its buffer, and I think
> I need to call Flush() on it, but there is no flush?


What is the error message?  Stack trace?


>
>
> thx
>
> - Alex
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to