https://bugzilla.novell.com/show_bug.cgi?id=434514


           Summary: Error in Write/Read encoded integer
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Cecil
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


You have

                public static int WriteCompressedInteger (BinaryWriter writer,
int value)
                {
                        if (value < 0x80)
                                writer.Write ((byte) value);
                        else if (value < 0x4000) {
                                writer.Write ((byte) (0x80 | (value >> 8)));
                                writer.Write ((byte) (value & 0xff));
                        } else {
                                writer.Write ((byte) ((value >> 24) | 0xc0));
                                writer.Write ((byte) ((value >> 16) & 0xff));
                                writer.Write ((byte) ((value >> 8) & 0xff));
                                writer.Write ((byte) (value & 0xff));
                        }
                        return (int) writer.BaseStream.Position;
                }

but this isn't correct, I don't know what the correct function is but I
compared this function writing 0x181 and microsoft C# 2005 and they wrote them
differently.

your func = 0x8101
microsoft = 0x8301
BinaryWriter.Write7BitEncodedInt = 0x8103

the regular 7 bit encoder seems to be it but it reads it backwards or
something.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to