static int ReadString(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                GameFramework.ByteBuffer obj = (GameFramework.ByteBuffer)ToLua.CheckObject <GameFramework.ByteBuffer>(L, 1);
                string o = obj.ReadString();
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else if (count == 2)
            {
                GameFramework.ByteBuffer obj = (GameFramework.ByteBuffer)ToLua.CheckObject <GameFramework.ByteBuffer>(L, 1);
                int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                string o    = obj.ReadString(arg0);
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: GameFramework.ByteBuffer.ReadString"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int ReadString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         GameFramework.ByteBuffer obj = (GameFramework.ByteBuffer)ToLua.CheckObject <GameFramework.ByteBuffer>(L, 1);
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        public void Send(ByteBuffer buffer)
        {
            string _json = buffer.ReadString();
            Dictionary <string, string> _kvs = LitJson.JsonMapper.ToObject <Dictionary <string, string> >(_json);

            //两个必要参数:http请求类型和子路径
            string _met = _kvs.ContainsKey("__methods") ? _kvs["__methods"] : "get";

            _met = _met.ToLower();
            _kvs.Remove("__methods");
            string _suburl = _kvs.ContainsKey("__suburl") ? _kvs["__suburl"] : string.Empty;

            _kvs.Remove("__suburl");

            _suburl = Utility.MergeString(fullUrl, _suburl);
            if (_met.Equals("get"))
            {
                SendGet(_suburl, _kvs);
            }
            else
            {
                SendPost(_suburl, _kvs);
            }
        }