private void writeBytes(int fieldNumber, byte[] src, int offset, int length, boolean repeated, boolean utf8)
            throws IOException
    {

        if (lastNumber == fieldNumber && lastRepeated)
        {
            // repeated field
            tail = packSink.packBinaryHeader(length, this, tail);
            tail = packSink.packBytes(src, offset, length, this, tail);
            arraySize++;
            return;
        }

        if (lastRepeated)
        {
            writeEndArray();
        }

        writeFieldNumber(fieldNumber);

        if (repeated)
        {
            writeStartArray();
        }

        tail = packSink.packBinaryHeader(length, this, tail);
        tail = packSink.packBytes(src, offset, length, this, tail);

        lastNumber = fieldNumber;
        lastRepeated = repeated;

    }
Returns true if the last written field was a repeated field.
protostuff-msgpack/src/main/java/io/protostuff/MsgpackXOutput.java