Package org.jgroups.util

Examples of org.jgroups.util.ByteArrayDataOutputStream.writeFloat()


    public void testFloat() throws IOException {
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(1024);
        float[] numbers={-322649.25f, 100.7531f, 0f, 1f, 2.75f, 3.1425f, 322649f, 322649.75f};
        for(float i: numbers)
            out.writeFloat(i);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(float i: numbers) {
            float num=in.readFloat();
            assert num == i;
        }
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.