Example #1
0
        private ABCFile.MethodInfo readMethodInfo()
        {
            var r = new ABCFile.MethodInfo();

            r.paramTypes = new uint[readU30()];
            r.returnType = readU30();
            for (int i = 0; i < r.paramTypes.Length; i++)
            {
                r.paramTypes[i] = readU30();
            }
            r.name  = readU30();
            r.flags = (MethodFlags)readU8();
            if ((r.flags & MethodFlags.HAS_OPTIONAL) != 0)
            {
                r.options = new ABCFile.OptionDetail[readU30()];
                for (int i = 0; i < r.options.Length; i++)
                {
                    r.options[i] = readOptionDetail();
                }
            }
            if ((r.flags & MethodFlags.HAS_PARAM_NAMES) != 0)
            {
                r.paramNames = new uint[readU30()];
                for (int i = 0; i < r.paramNames.Length; i++)
                {
                    r.paramNames[i] = readU30();
                }
            }
            return(r);
        }
Example #2
0
 private void writeMethodInfo(ABCFile.MethodInfo v)
 {
     writeU30((uint)v.paramTypes.Length);
     writeU30(v.returnType);
     foreach (var value in v.paramTypes)
     {
         writeU30(value);
     }
     writeU30(v.name);
     writeU8((byte)v.flags);
     if ((v.flags & MethodFlags.HAS_OPTIONAL) != 0)
     {
         writeU30((uint)v.options.Length);
         foreach (var option in v.options)
         {
             writeOptionDetail(option);
         }
     }
     if ((v.flags & MethodFlags.HAS_PARAM_NAMES) != 0)
     {
         foreach (var value in v.paramNames)
         {
             writeU30(value);
         }
     }
 }