class PRIndirectReference extends PdfIndirectReference {

    protected PdfReader reader;
    // membervariables

    // constructors

    /**
     * Constructs a <CODE>PdfIndirectReference</CODE>.
     *
     * @param reader     a <CODE>PdfReader</CODE>
     * @param number     the object number.
     * @param generation the generation number.
     */

    public PRIndirectReference(PdfReader reader, int number, int generation) {
        type = INDIRECT;
        this.number = number;
        this.generation = generation;
        this.reader = reader;
    }

    /**
     * Constructs a <CODE>PdfIndirectReference</CODE>.
     *
     * @param reader a <CODE>PdfReader</CODE>
     * @param number the object number.
     */

    public PRIndirectReference(PdfReader reader, int number) {
        this(reader, number, 0);
    }

    // methods

    public void toPdf(PdfWriter writer, OutputStream os) throws IOException {<FILL_FUNCTION_BODY>}

    public PdfReader getReader() {
        return reader;
    }

    public void setNumber(int number, int generation) {
        this.number = number;
        this.generation = generation;
    }
}

        int n = writer.getNewObjectNumber(reader, number, generation);
        os.write(PdfEncodings.convertToBytes(new StringBuffer().append(n).append(" 0 R").toString(), null));
    
<methods>public int getGeneration() ,public int getNumber() ,public java.lang.String toString() <variables>protected int generation,protected int number