ReadInt32() public method

public ReadInt32 ( ) : int
return int
コード例 #1
0
ファイル: Amf0Decoder.cs プロジェクト: artema/DotAmf
        public override sealed AmfHeaderDescriptor ReadPacketHeader(Stream stream)
        {
            var reader = new AmfStreamReader(stream);
            var context = CreateDefaultContext();

            try
            {
                var descriptor = new AmfHeaderDescriptor
                                     {
                                         Name = ReadString(reader),
                                         MustUnderstand = reader.ReadBoolean()
                                     };

                reader.ReadInt32(); //Header length

                context.ResetReferences();
                return descriptor;
            }
            catch (Exception e)
            {
                throw new FormatException(Errors.Amf0Deserializer_ReadPacketHeaders_InvalidFormat, e);
            }
        }
コード例 #2
0
ファイル: Amf0Decoder.cs プロジェクト: artema/DotAmf
        public override sealed AmfMessageDescriptor ReadPacketBody(Stream stream)
        {
            var reader = new AmfStreamReader(stream);
            var context = CreateDefaultContext();

            try
            {
                var descriptor = new AmfMessageDescriptor
                                     {
                                         Target = ReadString(reader),
                                         Response = ReadString(reader)
                                     };

                reader.ReadInt32(); //Message length

                context.ResetReferences();
                return descriptor;
            }
            catch (Exception e)
            {
                throw new FormatException(Errors.Amf0Deserializer_ReadPacketMessages_InvalidFormat, e);
            }
        }