static void checkFixedDelimited(CharSequence str) throws Exception
    {
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        OutputStreamWriter writer = new OutputStreamWriter(bout, "UTF-8");
        bout.write(getShortStringLengthInBytes(str));
        writer.write(str.toString(), 0, str.length());
        writer.close();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        LinkedBuffer lb = new LinkedBuffer(BUF_SIZE);
        WriteSession session = new WriteSession(lb, out);
        StreamedStringSerializer.writeUTF8FixedDelimited(str, session, lb);
        LinkedBuffer.writeTo(out, lb);

        byte[] b1 = bout.toByteArray();

        byte[] b2 = out.toByteArray();

        assertEquals(b1, b2);
    }
Tests for streaming UTF-8 Encoding

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