Code example for RandomAccessFile

Methods: closeseeksetLength

0
 
        reg.getConfiguration().reparseConfigFileSecuritySections();
 
        assertTrue(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
 
        fileBRandom = new RandomAccessFile(fileB, "rw");
        fileBRandom.setLength(0);
        fileBRandom.seek(0);
        fileBRandom.close();
 
        out = new FileWriter(fileB);
        out.write("<firewall>\n");
        out.write("\t<rule access=\"deny\" network=\"127.0.0.1\"/>");
        out.write("</firewall>\n");
        out.close();
 
        reg.getConfiguration().reparseConfigFileSecuritySections();
 
        assertFalse(reg.getSecurityManager().accessVirtualhost("test", new InetSocketAddress("127.0.0.1", 65535)));
    } 
Connect your IDE to all the code out there  Get Codota for Java