Exemple #1
0
        public Form1()
        {
            InitializeComponent();
            RPC_Example r = new RPC_Example();

            string str = "hello!";

            /*ObjectInfo oo = new ObjectInfo();
            oo.typeName = "sds";
            oo.objectData = new byte[10];
            for (int f = 0; f < 10; f++)
            {
                oo.objectData[f] =(byte) f;
            }*
             */

            ff asfsa = new ff();

            ObjectInfo o1 = new ObjectInfo(asfsa);

            object d1 = o1.GetObject();

            //           string hi =(string) o1.GetObject();

            int b = 5;
        }
Exemple #2
0
 /// <summary>
 /// Преобразование массива в объект
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static object ByteMassToObject(byte[] data)
 {
     ObjectInfo oi = new ObjectInfo(data);
     object rez = oi.GetObject();
     return rez;
 }
Exemple #3
0
 /// <summary>
 /// Преобразование объекта в массив байт
 /// </summary>
 /// <param name="ob"></param>
 /// <returns></returns>
 public static byte[] ObjectToByteMass(object ob)
 {
     ObjectInfo oi = new ObjectInfo(ob);
     byte[] rez = oi.GetMass();
     return rez;
 }
        public byte[] puck(params object[] objects)
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter br = new BinaryWriter(stream);

            foreach (var obj in objects)
            {
                ObjectInfo oi = new ObjectInfo(obj);
                byte [] objMass = oi.GetMass();
                int lenght = objMass.Length;

                br.Write(lenght);
                br.Write(objMass);
            }

            return null;
        }