JVM学习笔记16——类加载器重要方法详解
发布日期:2021-06-29 01:18:52
浏览次数:2
分类:技术文章
本文共 1512 字,大约阅读时间需要 5 分钟。
defineClass详解
protected final Class<?> defineClass(String name,
byte[] b, int off, int len) throws ClassFormatError Converts an array of bytes into an instance of class Class. Before the Class can be used it must be resolved. This method assigns a default ProtectionDomain to the newly defined class. The ProtectionDomain is effectively granted the same set of permissions returned when Policy.getPolicy().getPermissions(new CodeSource(null, null)) is invoked. The default domain is created on the first invocation of defineClass, and re-used on subsequent invocations. To assign a specific ProtectionDomain to the class, use the defineClass method that takes a ProtectionDomain as one of its arguments. Parameters: name - The expected binary name of the class, or null if not known b - The bytes that make up the class data. The bytes in positions off through off+len-1 should have the format of a valid class file as defined by The Java™ Virtual Machine Specification. off - The start offset in b of the class data len - The length of the class data Returns: The Class object that was created from the specified class data. Throws: ClassFormatError - If the data did not contain a valid class IndexOutOfBoundsException - If either off or len is negative, or if off+len is greater than b.length. SecurityException - If an attempt is made to add this class to a package that contains classes that were signed by a different set of certificates than this class (which is unsigned), or if name begins with "java.".转载地址:https://blog.csdn.net/yshuoo/article/details/116520105 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月15日 01时44分41秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
python初学者入门学习笔记:字符串的操作(获取输入/格式化)
2019-04-29
python初学者入门学习笔记:数据结构列表
2019-04-29
python初学者入门学习笔记:数据结构集合
2019-04-29
python初学者入门学习笔记:数据结构字典
2019-04-29
python初学者入门学习笔记:循环
2019-04-29
python初学者入门学习笔记:条件/跳出与结束循环
2019-04-29
python初学者入门学习笔记:运算符与随机数
2019-04-29
python初学者入门学习笔记:关键字
2019-04-29
python初学者入门学习笔记:内置函数
2019-04-29
python:Requests+正则爬取网页数据
2019-04-29
Python:模拟 Ajax 请求抓取今日头条街拍美图
2019-04-29
Python使用Selenium模拟浏览器抓取淘宝商品美食信息
2019-04-29
Python:Flask + Redis 维护代理池
2019-04-29
python使用代理处理反爬抓取微信文章
2019-04-29
python爬虫框架:scrapy 的安装与使用
2019-04-29
python爬虫框架:scrapy 命令行详解
2019-04-29
Python爬虫-博客园首页推荐博客排行(整合词云+邮件发送)
2019-04-29
PyGame实现情人节表白利器
2019-04-29
Python-图片文字识别
2019-04-29
Python-制作抖音图片
2019-04-29