static void checkVarDelimited(CharSequence str, int size, int stringLen) throws Exception
    {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        LinkedBuffer lb = new LinkedBuffer(BUF_SIZE);
        WriteSession session = new WriteSession(lb, out);
        StreamedStringSerializer.writeUTF8VarDelimited(str, session, lb);
        LinkedBuffer.writeTo(out, lb);

        byte[] buf = out.toByteArray();

        assertTrue(buf.length == stringLen + size);

        int len = readRawVarint32(buf, 0);
        assertTrue(len == stringLen);

        print("total len: " + buf.length);
    }
Tests for streaming UTF-8 Encoding

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