public static LinkedBuffer writeUTF8FixedDelimited(final CharSequence str,
            final boolean littleEndian, final WriteSession session, LinkedBuffer lb)
    {
        final int lastSize = session.size, len = str.length(), withIntOffset = lb.offset + 2;

        if (withIntOffset > lb.buffer.length)
        {
            // not enough space for int (2 bytes).
            // create a new buffer.
            lb = new LinkedBuffer(len + 2 > session.nextBufferSize ? len + 2 : session.nextBufferSize,
                    lb);

            lb.offset = 2;

            if (len == 0)
            {
                writeFixed2ByteInt(0, lb.buffer, 0, littleEndian);
                // update size
                session.size += 2;
                return lb;
            }

            // fast path
            final LinkedBuffer rb = writeUTF8(str, 0, len, session, lb);

            writeFixed2ByteInt((session.size - lastSize), lb.buffer, 0, littleEndian);

            // update size
            session.size += 2;

            return rb;
        }

        if (len == 0)
        {
            writeFixed2ByteInt(0, lb.buffer, lb.offset, littleEndian);
            lb.offset = withIntOffset;
            // update size
            session.size += 2;
            return lb;
        }

        if (withIntOffset + len > lb.buffer.length)
        {
            // not enough space for the string.
            lb.offset = withIntOffset;

            // slow path
            final LinkedBuffer rb = writeUTF8(str, 0, len,
                    lb.buffer, withIntOffset, lb.buffer.length, session, lb);

            writeFixed2ByteInt((session.size - lastSize), lb.buffer,
                    withIntOffset - 2, littleEndian);

            // update size
            session.size += 2;

            return rb;
        }

        // everything fits
        lb.offset = withIntOffset;

        final LinkedBuffer rb = writeUTF8(str, 0, len, session, lb);

        writeFixed2ByteInt((session.size - lastSize), lb.buffer,
                withIntOffset - 2, littleEndian);

        // update size
        session.size += 2;

        return rb;
    }
The length of the utf8 bytes is written first before the string - which is fixed 2-bytes.
protostuff-api/src/main/java/io/protostuff/StringSerializer.java