Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
0
        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;
        }