public void testUTF8VarDelimited() throws Exception
    {
        checkVarDelimited(foo, 1, 71);
        checkVarDelimited(whitespace, 1, 3);
        checkVarDelimited(numeric, 1, 10);
        checkVarDelimited(alphabet, 1, 26);
        checkVarDelimited(alphabet_to_upper, 1, 26);
        checkVarDelimited(two_byte_utf8, 1, 4 * 2);
        checkVarDelimited(three_byte_utf8, 1, 4 * 3);
        checkVarDelimited("1234567890123456789012345678901234567890", 1, 40);
        checkVarDelimited("", 1, 0);
        checkVarDelimited(str_len_130, 2, 130);
        checkVarDelimited(str_len_130.substring(10), 1, 120);

        String lessThan2048 = str_len_130;
        for (int i = 0; i < 14; i++)
            lessThan2048 += str_len_130;

        int lt2048Len = 130 * 15;
        assertTrue(lessThan2048.length() == lt2048Len);
        checkVarDelimited(lessThan2048, 2, lt2048Len);

        String moreThan2048 = str_len_130;
        for (int i = 0; i < 20; i++)
            moreThan2048 += str_len_130;

        int expectedLen = 130 * 21;
        assertTrue(moreThan2048.length() == expectedLen);

        checkVarDelimited(moreThan2048, 2, expectedLen);

        String str16383 = repeatChar('z', 16383);
        String str16384 = str16383 + "g";

        checkVarDelimited(str16383, 2, str16383.length());
        checkVarDelimited(str16384, 3, str16384.length());
    }
Tests for streaming UTF-8 Encoding

@author David Yu
@created Sep 18, 2010
protostuff-api/src/test/java/io/protostuff/StreamedStringSerializerTest.java