Ejemplo n.º 1
0
        public int decode(wire obj, byte[] data, int size)
        {
            int    len = bufflen;
            IntPtr st  = query(obj._name());

            while (bufflen < size)
            {
                bufflen *= 2;
            }
            if (bufflen != len)
            {
                buff = Marshal.ReAllocHGlobal(buff, (IntPtr)bufflen);
            }
            Marshal.Copy(data, 0, buff, size);
            return(obj._decode(buff, size, st));
        }
Ejemplo n.º 2
0
        public int decode(wire obj, byte[] data, int size)
        {
            int    ret;
            IntPtr st = query(obj._name());

            while (buffsize < size)
            {
                buffsize *= 2;
            }
            IntPtr buff = Marshal.AllocHGlobal(buffsize);

            Marshal.Copy(data, 0, buff, size);
            ret = obj._decode(buff, size, st);
            Marshal.FreeHGlobal(buff);
            return(ret);
        }
Ejemplo n.º 3
0
        public int decode(wire obj, IntPtr data, int size)
        {
            IntPtr st = query(obj._name());

            return(obj._decode(data, size, st));
        }