You can use UnknownFieldSet, but be warned that the interface for that class is likely to change in a future version (because the current design is somewhat inefficient). If you just want to print the contents, you should be fine -- just parse into an UnknownFieldSet and then call its toString() method. Those parts won't change. On Tue, Jun 23, 2009 at 7:46 AM, Toph <clo...@gmail.com> wrote:
> > Hi folks, > > I understand that protocol buffers messages are not fully self- > describing. > However, the message contains the field number, wire type, and value, > right? > > In Java, how can I take a byte[] (array of bytes) that represents a > message and deserialize it into a list of tuples that contain the > field number, wire type, and value? I really just want to print out > these tuples, even if the value is binary. > > Do any of the classes i the Java API provide a mechanism to do this? > I know I could just take the documentation of the encoding and write > code myself, but I am hoping that one of the API classes exists in a > usable or near-usable form to do this for me. Will CodedInputStream > do it? Can I use any of the parseFrom() or mergeFrom() methods? > > Note that I do not have the corresponding .proto file in source form, > compiled form, or available to transmit along with any messages > > Thanks > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---