private <T> void writeSingleObject(int fieldNumber, T value, Schema<T> schema) throws IOException
    {
        Schema<?> lastSchema = this.schema;
        int lastMapSize = this.mapSize;
        int lastArraySize = this.arraySize;
        boolean saveLastRepeated = this.lastRepeated;
        LinkedBuffer lastArrayHeader = this.arrayHeader;

        // reset
        reset();
        use(schema);

        LinkedBuffer objectHeader = writeStartObject();

        // recursive write
        schema.writeTo(this, value);

        if (isLastRepeated()) {
            writeEndArray();
        }
        
        writeEndObject(objectHeader);

        this.schema = lastSchema;
        this.mapSize = lastMapSize;
        this.arraySize = lastArraySize;
        this.arrayHeader = lastArrayHeader;
        this.lastRepeated = saveLastRepeated;
        this.lastNumber = fieldNumber;
    }
Returns true if the last written field was a repeated field.
protostuff-msgpack/src/main/java/io/protostuff/MsgpackXOutput.java