Package com.ibm.icu.util

Examples of com.ibm.icu.util.ByteArrayWrapper


//#if defined(FOUNDATION10) || defined(J2SE13)
//##        com.ibm.icu.impl.ByteBuffer buffer = com.ibm.icu.impl.ByteBuffer.wrap(ba);
//#else
        java.nio.ByteBuffer buffer = java.nio.ByteBuffer.wrap(ba);
//#endif
        ByteArrayWrapper x = new ByteArrayWrapper(buffer);
       
        ByteArrayWrapper y = new ByteArrayWrapper(ba, 3);
        ByteArrayWrapper z = new ByteArrayWrapper(bb, 3);

       
        if (!y.toString().equals("00 01 02")){
            errln("FAIL: test toString : Failed!");
        }
       
        // test equality
        if (!x.equals(y) || !x.equals(z))
            errln("FAIL: test (operator ==): Failed!");
        if (x.hashCode()!=y.hashCode())
            errln("FAIL: identical objects have different hash codes.");

        // test non-equality
        y = new ByteArrayWrapper(bb, 4);
        if (x.equals(y))
            errln("FAIL: test (operator !=): Failed!");

        // test sign of unequal comparison
        if ((x.compareTo(y) > 0) != (y.compareTo(x) < 0)) {
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.ByteArrayWrapper

Copyright © 2018 www.massapicom. 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.