@Override
    public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException
    {
        if (lastNumber == fieldNumber)
        {
            // repeated field
            generator.writeNumber(value);
            return;
        }

        final JsonGenerator generator = this.generator;

        if (lastRepeated)
            generator.writeEndArray();

        final String name = numeric ? Integer.toString(fieldNumber) :
                schema.getFieldName(fieldNumber);

        if (repeated)
        {
            generator.writeArrayFieldStart(name);
            generator.writeNumber(value);
        }
        else
            generator.writeNumberField(name, value);

        lastNumber = fieldNumber;
        lastRepeated = repeated;
    }
Returns true if the last written field was a repeated field.
protostuff-json/src/main/java/io/protostuff/JsonOutput.java