Akka.Cluster.Tools.PublishSubscribe.Serialization.DistributedPubSubMessageSerializer.ToBinary C# (CSharp) Method

ToBinary() public method

public ToBinary ( object obj ) : byte[]
obj object
return byte[]
        public override byte[] ToBinary(object obj)
        {
            if (obj is Internal.Status) return Compress(StatusToProto(obj as Internal.Status));
            else if (obj is Internal.Delta) return Compress(DeltaToProto(obj as Internal.Delta));
            else if (obj is Send) return SendToProto(obj as Send).ToByteArray();
            else if (obj is SendToAll) return SendToAllToProto(obj as SendToAll).ToByteArray();
            else if (obj is Publish) return PublishToProto(obj as Publish).ToByteArray();
            else throw new ArgumentException(string.Format("Can't serialize object of type {0} with {1}", obj.GetType(), GetType()));
        }