Example of AMF that won't parse.


Here's some AMF that I can't get to work:

When debugging into this, the first thing I see is that all your debug strings gets ENORMOUS. This should probably be pulled out or placed in #if DEBUG conditionals.
If I remove that part, I end up with index out of bounds exceptions though, so this isn't enough. As far as I can tell, the header is way too big, and body length too small, so something is up with how it reads it.


freebird74 wrote Feb 22, 2012 at 4:56 PM

Please try with 1.2.0. We fixed all the issues we found and removed debugging messages from released build. Thanks.

SharpGIS wrote Feb 22, 2012 at 6:00 PM

Thanks! In the mean time I ended up writing my own though.
A takeaways from that that you might find beneficial too: Use BinaryReader instead of walking through a byte array. It makes the parsing a lot simpler and cleaner, and you can parse any stream in instead of forcing users to parse in a full byte array stored in memory.
I also found out that the reason the AMF I linked to wouldn't parse, is that your parser expects an AMF Header. Sometimes you just get the raw object directly, so there needs to be a ReadAMF3Data(Stream) method. Also the lack of object references and trait references wasn't fully completed either.