Package org.jgroups.util

Examples of org.jgroups.util.ByteArrayDataInputStream.readUTF()


        String name="Bela";
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
        assert out.position() == name.length() + 2;
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        String tmp=in.readUTF();
        assert name.equals(tmp);
    }

    public void testUTFWithDoubleByteChar() throws IOException {
        String name="Bela\234";
View Full Code Here


        String name="Bela\234";
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
        assert out.position() == Bits.sizeUTF(name);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        String tmp=in.readUTF();
        assert name.equals(tmp);
    }

    public void testUTFWithDoubleByteChar2() throws IOException {
        String name="Bela\420";
View Full Code Here

        String name="Bela\420";
        ByteArrayDataOutputStream out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
        assert out.position() == Bits.sizeUTF(name);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        String tmp=in.readUTF();
        assert name.equals(tmp);

        name="";
        out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
View Full Code Here

        name="";
        out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
        assert out.position() == Bits.sizeUTF(name);
        in=new ByteArrayDataInputStream(out.buffer());
        tmp=in.readUTF();
        assert name.equals(tmp);

        name=null;
        out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
View Full Code Here

        name=null;
        out=new ByteArrayDataOutputStream(2);
        out.writeUTF(name);
        assert out.position() == Bits.sizeUTF(name);
        in=new ByteArrayDataInputStream(out.buffer());
        tmp=in.readUTF();
        assert tmp == null;
    }

    public static void testReadLine() throws IOException {
        String str="Gallia est omnis divisa in partes tres,\n\rquarum unam incolunt Belgae,\naliam Aquitani," +
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.