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

        LinkedBuffer lb = new LinkedBuffer(512);
        WriteSession session = new WriteSession(lb);
        StringSerializer.writeUTF8FixedDelimited(str, session, lb);

        byte[] b1 = out.toByteArray();
        byte[] b2 = session.toByteArray();

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

@author David Yu
@created Jul 6, 2010
protostuff-api/src/test/java/io/protostuff/StringSerializerTest.java