static void transferObject(Pipe.Schema<Object> pipeSchema, Pipe pipe,
            Input input, Output output, IdStrategy strategy) throws IOException
    {
        final int number = input.readFieldNumber(pipeSchema.wrappedSchema);
        if (number == ID_POJO)
        {
            // AtomicInteger/AtomicLong
            final Pipe.Schema<Object> derivedPipeSchema = strategy
                    .transferPojoId(input, output, number).getPipeSchema();

            if (output instanceof StatefulOutput)
            {
                // update using the derived schema.
                ((StatefulOutput) output).updateLast(derivedPipeSchema,
                        pipeSchema);
            }

            Pipe.transferDirect(derivedPipeSchema, pipe, input, output);
            return;
        }

        switch (number)
        {
            case ID_BYTE:
                BYTE.transfer(pipe, input, output, number, false);
                break;
            case ID_SHORT:
                SHORT.transfer(pipe, input, output, number, false);
                break;
            case ID_INT32:
                INT32.transfer(pipe, input, output, number, false);
                break;
            case ID_INT64:
                INT64.transfer(pipe, input, output, number, false);
                break;
            case ID_FLOAT:
                FLOAT.transfer(pipe, input, output, number, false);
                break;
            case ID_DOUBLE:
                DOUBLE.transfer(pipe, input, output, number, false);
                break;
            case ID_BIGDECIMAL:
                BIGDECIMAL.transfer(pipe, input, output, number, false);
                break;
            case ID_BIGINTEGER:
                BIGINTEGER.transfer(pipe, input, output, number, false);
                break;
            default:
                throw new ProtostuffException("Corrupt input.");
        }
    }
Used when the type is {@link java.lang.Number}.

@author David Yu
@created Apr 30, 2012
protostuff-runtime/src/main/java/io/protostuff/runtime/NumberSchema.java