Package org.jgroups.util

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


        out=new ByteArrayDataOutputStream(1);
        out.writeBoolean(true);
        out.writeBoolean(false);

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

        out=new ByteArrayDataOutputStream(1);
        out.writeInt(23);
        out.writeInt(24);
View Full Code Here


        out.writeBoolean(true);
        out.writeBoolean(false);

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

        out=new ByteArrayDataOutputStream(1);
        out.writeInt(23);
        out.writeInt(24);
    }
View Full Code Here

    }

    public void testShort() throws IOException {
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(Short.MAX_VALUE * 4 + 10);
        for(int i=Short.MIN_VALUE; i <= Short.MAX_VALUE; i++)
            out.writeShort(i);

        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(int i=Short.MIN_VALUE; i <= Short.MAX_VALUE; i++) {
            short read=in.readShort();
            assert i == read;
View Full Code Here

        }
    }

    public void testUnsignedShort() throws IOException {
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(20);
        out.writeShort(-22);
        out.writeShort(22);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        short num=in.readShort();
        assert num == -22;
        num=in.readShort();
View Full Code Here

    }

    public void testUnsignedShort() throws IOException {
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(20);
        out.writeShort(-22);
        out.writeShort(22);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        short num=in.readShort();
        assert num == -22;
        num=in.readShort();
        assert num == 22;
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.