Package com.fasterxml.uuid

Examples of com.fasterxml.uuid.EthernetAddress.toByteArray()


            NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
       
        // now test a non-null EthernetAddress
        ethernet_address = new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);
        Arrays.fill(test_array, (byte)'x');
        ethernet_address.toByteArray(test_array);
        assertEthernetAddressArraysAreEqual(
            VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
       
        // now test a null EthernetAddress case with extra data in the array
        ethernet_address = new EthernetAddress(0L);
View Full Code Here


       
        // now test a null EthernetAddress case with extra data in the array
        ethernet_address = new EthernetAddress(0L);
        test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];
        Arrays.fill(test_array, (byte)'x');
        ethernet_address.toByteArray(test_array);
        assertEthernetAddressArraysAreEqual(NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
        for (int i = 0; i < EXTRA_DATA_LENGTH; i++)
        {
            assertEquals("Expected array fill value changed",
                        (byte)'x',
View Full Code Here

        ethernet_address =
            new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);
        test_array =
            new byte[ETHERNET_ADDRESS_ARRAY_LENGTH + EXTRA_DATA_LENGTH];
        Arrays.fill(test_array, (byte)'x');
        ethernet_address.toByteArray(test_array);
        assertEthernetAddressArraysAreEqual(
            VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
        for (int i = 0; i < EXTRA_DATA_LENGTH; i++)
        {
            assertEquals("Expected array fill value changed",
View Full Code Here

        // lets test some error cases
        // first, passing null and 0
        try
        {
            EthernetAddress ethernet_address = new EthernetAddress(0L);
            ethernet_address.toByteArray((byte[])null, 0);
            // if we reached here we failed because we didn't get an exception
            fail("Expected exception not caught");
        }
        catch (NullPointerException ex)
        {
View Full Code Here

        try
        {
            EthernetAddress ethernet_address = new EthernetAddress(0L);
            byte[] ethernet_address_byte_array =
                new byte[ETHERNET_ADDRESS_ARRAY_LENGTH - 1];
            ethernet_address.toByteArray(ethernet_address_byte_array, 0);
            // if we reached here we failed because we didn't get an exception
            fail("Expected exception not caught");
        } catch (IllegalArgumentException ex) {
            // this is the success case so do nothing
        } catch (Exception ex) {
View Full Code Here

        // now an index that is negative
        try {
            EthernetAddress ethernet_address = new EthernetAddress(0L);
            byte[] ethernet_address_byte_array =
                new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];
            ethernet_address.toByteArray(ethernet_address_byte_array, -1);
            // if we reached here we failed because we didn't get an exception
            fail("Expected exception not caught");
        } catch (IllegalArgumentException ex) {
            // this is the success case so do nothing
        } catch (Exception ex) {
View Full Code Here

        try
        {
            EthernetAddress ethernet_address = new EthernetAddress(0L);
            byte[] ethernet_address_byte_array =
                new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];
            ethernet_address.toByteArray(
                ethernet_address_byte_array, ETHERNET_ADDRESS_ARRAY_LENGTH);
            // if we reached here we failed because we didn't get an exception
            fail("Expected exception not caught");
        } catch (IllegalArgumentException ex) {
            // this is the success case so do nothing
View Full Code Here

        // but without enough bytes to read ETHERNET_ADDRESS_ARRAY_LENGTH
        try {
            EthernetAddress ethernet_address = new EthernetAddress(0L);
            byte[] ethernet_address_byte_array =
                new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];
            ethernet_address.toByteArray(ethernet_address_byte_array, 1);
            // if we reached here we failed because we didn't get an exception
            fail("Expected exception not caught");
        } catch (IllegalArgumentException ex) {
            // this is the success case so do nothing
        } catch (Exception ex) {
View Full Code Here

       
        // here we'll test the null EthernetAddress at offset 0
        EthernetAddress ethernet_address = new EthernetAddress(0L);
        byte[] test_array = new byte[ETHERNET_ADDRESS_ARRAY_LENGTH];
        Arrays.fill(test_array, (byte)'x');
        ethernet_address.toByteArray(test_array, 0);
        assertEthernetAddressArraysAreEqual(
            NULL_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
       
        // now test a non-null EthernetAddress
        ethernet_address =
View Full Code Here

       
        // now test a non-null EthernetAddress
        ethernet_address =
            new EthernetAddress(MIXED_CASE_VALID_ETHERNET_ADDRESS_STRING);
        Arrays.fill(test_array, (byte)'x');
        ethernet_address.toByteArray(test_array);
        assertEthernetAddressArraysAreEqual(
            VALID_ETHERNET_ADDRESS_BYTE_ARRAY, 0, test_array, 0);
       
        // now test a null EthernetAddress case with extra data in the array
        ethernet_address = new EthernetAddress(0L);
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.