Exemple #1
0
        public object ReadResult(Type returnType)
        {
            object result;

            byte[] data = ByteArrayMarshaler.Demarshal(InputStream);
            using (MemoryStream stream = new MemoryStream(data))
            {
                ITypeMarshaler marshaler = MarshalingManager.GetMarshaler(returnType);
                result = marshaler.DemarshalObject(stream);
            }
            return(result);
        }
Exemple #2
0
 public void WriteArguments(object[] arguments)
 {
     byte[] data;
     using (MemoryStream stream = new MemoryStream())
     {
         foreach (object argument in arguments)
         {
             MarshalingManager.Marshal(argument, stream);
         }
         data = stream.ToArray();
     }
     ByteArrayMarshaler.Marshal(data, OutputStream);
 }
Exemple #3
0
 public void WriteResult(object result)
 {
     if (result == null)
     {
         return;
     }
     byte[] data;
     using (MemoryStream stream = new MemoryStream())
     {
         MarshalingManager.Marshal(result, stream);
         data = stream.ToArray();
     }
     ByteArrayMarshaler.Marshal(data, OutputStream);
 }
Exemple #4
0
 public object[] ReadArguments(Type[] signature)
 {
     object[] arguments = new object[signature.Length];
     byte[]   data      = ByteArrayMarshaler.Demarshal(InputStream);
     using (MemoryStream stream = new MemoryStream(data))
     {
         for (int i = 0; i < arguments.Length; i++)
         {
             Type           type      = signature[i];
             ITypeMarshaler marshaler = MarshalingManager.GetMarshaler(type);
             arguments[i] = marshaler.DemarshalObject(stream);
         }
     }
     return(arguments);
 }