Ejemplo n.º 1
0
        public override void WriteManifest(Stream stream, SerializerSession session)
        {
            ushort typeIdentifier;

            if (session.ShouldWriteTypeManifest(TypeEx.RuntimeType, out typeIdentifier))
            {
                stream.WriteByte(Manifest);
            }
            else
            {
                stream.Write(new[] { ObjectSerializer.ManifestIndex });
                UInt16Serializer.WriteValueImpl(stream, typeIdentifier, session);
            }
        }
Ejemplo n.º 2
0
        public override void WriteManifest(Stream stream, SerializerSession session)
        {
            ushort typeIdentifier;

            if (session.ShouldWriteTypeManifest(Type, out typeIdentifier))
            {
                session.TrackSerializedType(Type);

                var manifestToWrite = session.Serializer.Options.VersionTolerance
                    ? _manifestWithVersionInfo
                    : _manifest;

                stream.Write(manifestToWrite);
            }
            else
            {
                stream.WriteByte(ManifestIndex);
                UInt16Serializer.WriteValueImpl(stream, typeIdentifier, session);
            }
        }