silentorbit / protobuf

C# code generator for reading and writing the protocol buffers format
https://silentorbit.com/protobuf/
MIT License
307 stars 105 forks source link

Mono for Android: System.NotSupportedException #26

Closed canab closed 9 years ago

canab commented 9 years ago

Stream.position is not supported for android asset streams

stacktrace: at Android.Runtime.InputStreamInvoker.get_Position () at ActionLib.Proto.T_Sprite.DeserializeLengthDelimited (System.IO.Stream stream, ActionLib.Proto.T_Sprite instance)

line: stream.Position

binary: ProtoBuf-2014-08-23-bin.zip

hultqvist commented 9 years ago

There is a wrapper class included in the ProtocolParser.cs file called PositionStream(or StreamRead in older versions) use that to wrap whatever stream that does not support the position attribute.

canab commented 9 years ago

Thanks, it works.