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

            if (count == 0)
            {
                StarForce.ByteBuffer obj = new StarForce.ByteBuffer();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(byte[])))
            {
                byte[] arg0 = ToLua.CheckByteBuffer(L, 1);
                StarForce.ByteBuffer obj = new StarForce.ByteBuffer(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: StarForce.ByteBuffer.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         StarForce.ByteBuffer obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int WriteByte(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         StarForce.ByteBuffer obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         byte arg0 = (byte)LuaDLL.luaL_checknumber(L, 2);
         obj.WriteByte(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ToBytes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         StarForce.ByteBuffer obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         byte[] o = obj.ToBytes();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ReadBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         StarForce.ByteBuffer       obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         LuaInterface.LuaByteBuffer o   = obj.ReadBuffer();
         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);
         StarForce.ByteBuffer obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         string o = obj.ReadString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int WriteBuffer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         StarForce.ByteBuffer obj  = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         LuaByteBuffer        arg0 = new LuaByteBuffer(ToLua.CheckByteBuffer(L, 2));
         obj.WriteBuffer(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int WriteLong(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         StarForce.ByteBuffer obj = (StarForce.ByteBuffer)ToLua.CheckObject(L, 1, typeof(StarForce.ByteBuffer));
         long arg0 = LuaDLL.tolua_checkint64(L, 2);
         obj.WriteLong(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }