![]() Should I be using Coded or non-Coded streams? However, I'm not using a CodedInputStream to deserialize. Perhaps I'm serializing incorrectly? I'm creating a CodedOutputStream given an OutputStream and passing that to writeTo. I'm confident that the sender data is the same data that is created when I serialize. proto file that I'm using:Īny and all help is greatly appreciated. I have a feeling that I'm probably misusing the API forĭeserialization, or perhaps I may have mis-defined my. proto files each only have oneįield in each Message, and each of those fields has a tag of 1. $rgeFrom(AbstractMessage.java:329)Ĭom.(DynamicMessage.java:102) Here's the trace:Ĭom.: Protocol messageĬom.(InvalidProtocolBufferException.java:Ĭom.(CodedInputStream.java:67)Īt .mergeFrom(FieldSet.java:397) Getting an InvalidProtocolBufferException. The problem that I'm encountering is during deserialization. I then cast theĭynamicMessage that is returned by parseFrom to the same type of the Given a stream and an instance, I'm trying to get theĭescriptor by calling Message#getDescriptorForType() on the instanceĪnd passing the return value, along with an input stream, toĭynamicMessage#parseFrom(Descriptor,input). Given a stream and an instance, just call How can I use this information to serialize and deserialize? I will (InputStream or OutputStream) and an instance of a particular Message I have a scenario where I'm trying to create a Serializer andĭeserializer class that can handle any general Message, given a stream ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |