URLPermissionTest.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:jdk8u_jdk 作者:
static void serializationTest(String name, String actions)
    throws Exception {

    URLPermission out = new URLPermission(name, actions);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream o = new ObjectOutputStream(baos);
    o.writeObject(out);
    ByteArrayInputStream bain = new ByteArrayInputStream(baos.toByteArray());
    ObjectInputStream i = new ObjectInputStream(bain);
    URLPermission in = (URLPermission)i.readObject();
    if (!in.equals(out)) {
        System.out.println ("FAIL");
        System.out.println ("in = " + in);
        System.out.println ("out = " + out);
        failed = true;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号