Akka.Remote.Serialization.DaemonMsgCreateSerializer.FromBinary C# (CSharp) Method

FromBinary() public method

Deserializes a byte array into an object of type type.
/// Could not find type on the remote system. /// Ensure that the remote system has an assembly that contains the type in its assembly search path. ///
public FromBinary ( byte bytes, Type type ) : object
bytes byte The array containing the serialized object
type System.Type The type of object contained in the array
return object
        public override object FromBinary(byte[] bytes, Type type)
        {
            var proto = DaemonMsgCreateData.ParseFrom(bytes);
            Type clazz; 

            try
            {
                clazz = Type.GetType(proto.Props.Clazz, true);
            }
            catch (TypeLoadException ex)
            {
                var msg = string.Format(
                       "Could not find type '{0}' on the remote system. " +
                       "Ensure that the remote system has an assembly that contains the type {0} in its assembly search path", 
                       proto.Props.Clazz);


                throw new TypeLoadException(msg, ex);
            }

            var args = GetArgs(proto);
            var props = new Props(GetDeploy(proto.Props.Deploy), clazz, args);
            return new DaemonMsgCreate(
                props,
                GetDeploy(proto.Deploy),
                proto.Path,
                DeserializeActorRef( proto.Supervisor));
        }