Re: [protobuf] Re: CodedInputStream hanging in constructor

2010-02-25 Thread Kenton Varda
In C++ the destructor flushes the stream. Java does not have destructors, so an explicit flush was necessary. Note that allocating and destroying CodedStreams on the stack is very cheap. These objects are not designed to be long-lived. So, it's generally not necessary to flush one -- just let t

[protobuf] Re: CodedInputStream hanging in constructor

2010-02-25 Thread Patrick
I meant CodedOutputStream of course. On Feb 25, 9:18 pm, Patrick wrote: > I have investigated further and saw that the buffer wasn't being > flushed; I should of realized this earlier. > Any reason why the Java CodedInputStream has a flush method but the c+ > + API has no equivalent? > > On Feb 2

[protobuf] Re: CodedInputStream hanging in constructor

2010-02-25 Thread Patrick
I have investigated further and saw that the buffer wasn't being flushed; I should of realized this earlier. Any reason why the Java CodedInputStream has a flush method but the c+ + API has no equivalent? On Feb 25, 9:04 pm, Kenton Varda wrote: > Weird, read() on a socket should return as soon as