static int _CreateNetFramework_ByteBuffer(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { NetFramework.ByteBuffer obj = new NetFramework.ByteBuffer(); ToLua.PushObject(L, obj); return(1); } else if (count == 1) { byte[] arg0 = ToLua.CheckByteBuffer(L, 1); NetFramework.ByteBuffer obj = new NetFramework.ByteBuffer(arg0); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: NetFramework.ByteBuffer.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Close(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); obj.Close(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int WriteInt(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.WriteInt(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ToBytes(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); byte[] o = obj.ToBytes(); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ReadString(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); string o = obj.ReadString(); LuaDLL.lua_pushstring(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int WriteBytes(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); byte[] arg0 = ToLua.CheckByteBuffer(L, 2); obj.WriteBytes(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int WriteLong(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); NetFramework.ByteBuffer obj = (NetFramework.ByteBuffer)ToLua.CheckObject <NetFramework.ByteBuffer>(L, 1); long arg0 = LuaDLL.tolua_checkint64(L, 2); obj.WriteLong(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }