Examples of writeUTF()


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

    }

    public void testUTF() throws IOException {
        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);
    }
View Full Code Here

Examples of org.lilyproject.bytes.api.DataOutput.writeUTF()

    public void testRandomString() {
        for (int i = 0; i < 1000; i++) {
            String string = randomUnicodeString();
            DataOutput dataOutput = new DataOutputImpl();
            dataOutput.writeUTF(string);
            byte[] bytes = dataOutput.toByteArray();
            DataInput dataInput = new DataInputImpl(bytes);
            String result = dataInput.readUTF();
            Assert.assertEquals(string, result);
        }
View Full Code Here

Examples of org.lilyproject.bytes.impl.DataOutputImpl.writeUTF()

    public void testRandomString() {
        for (int i = 0; i < 1000; i++) {
            String string = randomUnicodeString();
            DataOutput dataOutput = new DataOutputImpl();
            dataOutput.writeUTF(string);
            byte[] bytes = dataOutput.toByteArray();
            DataInput dataInput = new DataInputImpl(bytes);
            String result = dataInput.readUTF();
            Assert.assertEquals(string, result);
        }
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.