Package sun.security.util

Examples of sun.security.util.BitArray.toByteArray()


            BitArray bitArray = new BitArray(MASKSIZE * 8);

            // set all most significant bits up to prefix length
            for (int i = 0; i < prefixLen; i++)
                bitArray.set(i, true);
            byte[] maskArray = bitArray.toByteArray();

            // copy mask bytes into mask portion of address
            for (int i = 0; i < MASKSIZE; i++)
                address[MASKSIZE+i] = maskArray[i];
        }
View Full Code Here


        ba = new BitArray(new boolean[] {
            true, true, true, true, true, true, true, true,
            false, false});
        check(ba.length(), 10);
        check(ba.toByteArray().length, 2);
        ba = ba.truncate();
        check(ba.length(), 8);
        check(ba.toByteArray().length, 1);

        ba = new BitArray(new boolean[] {
View Full Code Here

            false, false});
        check(ba.length(), 10);
        check(ba.toByteArray().length, 2);
        ba = ba.truncate();
        check(ba.length(), 8);
        check(ba.toByteArray().length, 1);

        ba = new BitArray(new boolean[] {
            true, true, true, true, true, true, true, true,
            true, false});
        check(ba.length(), 10);
View Full Code Here

        ba = new BitArray(new boolean[] {
            true, true, true, true, true, true, true, true,
            true, false});
        check(ba.length(), 10);
        check(ba.toByteArray().length, 2);
        ba = ba.truncate();
        check(ba.length(), 9);
        check(ba.toByteArray().length, 2);
    }
View Full Code Here

            true, false});
        check(ba.length(), 10);
        check(ba.toByteArray().length, 2);
        ba = ba.truncate();
        check(ba.length(), 9);
        check(ba.toByteArray().length, 2);
    }

    static void check(int la, int lb) throws Exception {
        if (la != lb) {
            System.err.println("Length is " + la + ", should be " + lb);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.