for (int i = 0; i < 127; i++)
write.writeString(String.valueOf((char)i));
for (int i = 0; i < 127; i++)
write.writeString(String.valueOf((char)i) + "abc");
Input read = new UnsafeInput(write.toBytes());
assertEquals("", read.readString());
assertEquals("1", read.readString());
assertEquals("22", read.readString());
assertEquals("uno", read.readString());
assertEquals("dos", read.readString());
assertEquals("tres", read.readString());
assertEquals(null, read.readString());
assertEquals(value1, read.readString());
assertEquals(value2, read.readString());
for (int i = 0; i < 127; i++)
assertEquals(String.valueOf((char)i), read.readString());
for (int i = 0; i < 127; i++)
assertEquals(String.valueOf((char)i) + "abc", read.readString());
read.rewind();
assertEquals("", read.readStringBuilder().toString());
assertEquals("1", read.readStringBuilder().toString());
assertEquals("22", read.readStringBuilder().toString());
assertEquals("uno", read.readStringBuilder().toString());
assertEquals("dos", read.readStringBuilder().toString());
assertEquals("tres", read.readStringBuilder().toString());
assertEquals(null, read.readStringBuilder());
assertEquals(value1, read.readStringBuilder().toString());
assertEquals(value2, read.readStringBuilder().toString());
for (int i = 0; i < 127; i++)
assertEquals(String.valueOf((char)i), read.readStringBuilder().toString());
for (int i = 0; i < 127; i++)
assertEquals(String.valueOf((char)i) + "abc", read.readStringBuilder().toString());
}