Exemplo n.º 1
0
        public static Checksum Create(WellKnownSynchronizationKind kind, IObjectWritable @object)
        {
            using (var stream = SerializableBytes.CreateWritableStream())
                using (var objectWriter = new ObjectWriter(stream))
                {
                    objectWriter.WriteInt32((int)kind);
                    @object.WriteTo(objectWriter);

                    return(Create(stream));
                }
        }
Exemplo n.º 2
0
        private void WriteObjectWorker(IObjectWritable writable)
        {
            // emit object header up front
            _objectReferenceMap.Add(writable);

            _writer.Write((byte)EncodingKind.Object);

            // Directly write out the type-id for this object.  i.e. no need to write out the 'Type'
            // tag since we just wrote out the 'Object' tag
            this.WriteInt32(_binderSnapshot.GetTypeId(writable.GetType()));
            writable.WriteTo(this);
        }
Exemplo n.º 3
0
        private void WriteWritableObject(IObjectWritable instance)
        {
            _writer.Write((byte)DataKind.Object_W);

            Type type = instance.GetType();

            this.WriteType(type);

            _binder?.Record(instance);

            instance.WriteTo(this);
        }
Exemplo n.º 4
0
        private void WriteWritableObject(IObjectWritable instance)
        {
            writer.Write((byte)DataKind.Object_W);

            Type type = instance.GetType();
            this.WriteType(type);

            if (this.binder != null)
            {
                this.binder.Record(instance);
            }

            instance.WriteTo(this);
        }
Exemplo n.º 5
0
 public static void WriteTo(this IObjectWritable @object, ObjectWriter writer)
 => @object.WriteTo(writer);
Exemplo n.º 6
0
 private void WriteObjectWorker(object instance, IObjectWritable writable)
 {
     // emit object header up front
     this.WriteObjectHeader(instance, 0);
     writable.WriteTo(this);
 }