e" and the stack-allocated streambuf looks suspect. If nothing
> jumps out there, I would first check that the data read from the socket in
> Java exactly matches the data on the C++ side.
>
> On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch
> wrote:
>
>
>
>
>
&g
Some other exceptions I receive as well:
Protocol message tag had invalid wire type.
Protocol message end-group tag did not match expected tag.
While parsing a protocol message, the input ended unexpectedly in the
middle of a field. This could mean either than the input has been
truncated or that
I am using **protobuf** now for some weeks, but I still keep getting
exceptions when parsing protobuf messages in **Java**.
I use **C++** to create my protobuf messages and send them with
**boost sockets** to a server socket where the Java client ist
listening. The C++ code for transmitting the me
Oh, maybe this line was flawed after all:
System.out.println(name.newBuilder().build().toString());
Which cannot work, can it? ;-)
I changed it to name.getName()
and there it is, the data I've sent, thank you!
--
You received this message because you are subscribed to the Google Groups
"Pro
only be reading the data read by
> SerializeToCodedStream(); you need to consume the WriteLittleEndian32 data
> separately.
>
> On Fri, Apr 15, 2011 at 10:01 AM, platzhirsch
> wrote:
>
>
>
>
>
>
>
> > I am sorry, could you clarify this? With destroy yo
I am sorry, could you clarify this? With destroy you mean call the
delete operator? The changes:
boost::asio::streambuf b;
std::ostream os(&b);
ZeroCopyOutputStream *raw_output = new OstreamOutputStream(&os);
CodedOutputStream *coded_output = new CodedOutputStream(raw_output);
coded_output->Writ
Right! I think I refactored the whole writing and reading, still I am
stuck. However by this I get this Exception:
com.google.protobuf.UninitializedMessageException: Message missing
required fields: name
In C++:
Name name;
name.set_name("platzhirsch");
boost::asio::streambuf b;
std::
required string name = 1;
}
Which I compile with:
protoc -I=. --cpp_out=../cpp/ name.proto
and
protoc -I=. --java_out=../java/ name.proto
In C++ I create the name object this way:
Name name;
name.set_name("platzhirsch");
socket.send(name.SerializeAsString);