public void testPartialSurrogatePair() throws Exception
    {
        // Make sure that we don't overflow or get out of bounds,
        // since pairs require 2 characters.
        String partial = "\uD83C";

        // 3 bytes can't hold a 4-byte encoding, but we
        // don't expect it to use the 4-byte encoding path,
        // since it's not a pair
        LinkedBuffer lb = new LinkedBuffer(3);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        WriteSession session = new WriteSession(lb, out);
        StreamedStringSerializer.writeUTF8(partial, session, lb);

        byte[] buffered = session.toByteArray();
    }
Tests for streaming UTF-8 Encoding

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