Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.UnsafeOutput.writeString()


    runStringTest(new UnsafeOutput(897));
    runStringTest(new UnsafeOutput(new ByteArrayOutputStream()));

    UnsafeOutput write = new UnsafeOutput(21);
    String value = "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234";
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());

    runStringTest(127);
    runStringTest(256);
View Full Code Here


    StringBuilder buffer = new StringBuilder();
    for (int i = 0; i < length; i++)
      buffer.append((char)i);

    String value = buffer.toString();
    write.writeString(value);
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());
    assertEquals(value, read.readStringBuilder().toString());
View Full Code Here

    for (int i = 0; i < length; i++)
      buffer.append((char)i);

    String value = buffer.toString();
    write.writeString(value);
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());
    assertEquals(value, read.readStringBuilder().toString());

    write.clear();
View Full Code Here

    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());
    assertEquals(value, read.readStringBuilder().toString());

    write.clear();
    write.writeString(buffer);
    write.writeString(buffer);
    read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readStringBuilder().toString());
    assertEquals(value, read.readString());
View Full Code Here

    assertEquals(value, read.readString());
    assertEquals(value, read.readStringBuilder().toString());

    write.clear();
    write.writeString(buffer);
    write.writeString(buffer);
    read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readStringBuilder().toString());
    assertEquals(value, read.readString());

    if (length <= 127) {
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.