Thanks for the suggestion but unfortunately equals with not tell me GT
or LT. Furthmore the encoding scheme is not byte sortable.  Take for
example varints which are LSB first, sint32 it uses a zig zag encoding
with -10 > 5, and strings which start with there length so "z" < "aa".
Not so good. Also double which are IEEE 754 are not byte comparable :-
(

Basically you need to walk the fields including nested types, and then
compare the primitives types, or bytes for strings.

I wish it was so simple :-(

On Oct 17, 6:03 pm, Jesper Eskilson <jes...@eskilson.se> wrote:
> On Sat, Oct 17, 2009 at 6:25 PM, Michael <michael...@hmamail.com> wrote:
>
> > int compare(byte[] b1, int s1,
> >                            byte[] b2, int s2,
> >                            Descriptors.Descriptor type)
>
>
> Can't you use Arrays#equals() for that?

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