Package org.jgroups.util

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


        out=new ByteArrayDataOutputStream(1);
        out.writeShort(22);
        out.writeShort(23);

        out=new ByteArrayDataOutputStream(1);
        out.writeInt(23);
        out.writeInt(24);
    }

    public void testSkipBytes() {
        byte[] buf={'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
View Full Code Here


        out.writeShort(22);
        out.writeShort(23);

        out=new ByteArrayDataOutputStream(1);
        out.writeInt(23);
        out.writeInt(24);
    }

    public void testSkipBytes() {
        byte[] buf={'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(buf);
View Full Code Here

    public void testInt() throws IOException {
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(1024);
        int[] numbers={Integer.MIN_VALUE, -322649, -500, 0, 1, 100, 322649, Integer.MAX_VALUE};
        for(int i: numbers)
            out.writeInt(i);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(int i: numbers) {
            int num=in.readInt();
            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.