public void checkVarDelimitedBoundry(int initialGap, int secondWriteSize) throws IOException
    {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int bufferSize = BUF_SIZE;
        final LinkedBuffer lb = new LinkedBuffer(bufferSize);
        WriteSession session = new WriteSession(lb, out, null, bufferSize);

        // Should fill up the buffer with initialGap byte(s) left
        StreamedStringSerializer.writeUTF8(repeatChar('a', bufferSize - initialGap), session, lb);

        // Write a string of length secondWriteSize that should be larger
        // than the next buffer size
        assertTrue(secondWriteSize > bufferSize);
        StreamedStringSerializer.writeUTF8VarDelimited(repeatChar('a', secondWriteSize), session, lb);
    }
Tests for streaming UTF-8 Encoding

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