Class PdfWriter.PdfBody.PdfCrossReference

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String CROSS_REFERENCE_ENTRY_FORMAT
      String template for cross-reference entry PDF representation.
      private int generation
      generation of the object.
      private long offset
      Byte offset in the PDF file.
      private int refnum  
      private int type  
    • Constructor Summary

      Constructors 
      Constructor Description
      PdfCrossReference​(int type, int refnum, long offset, int generation)  
      PdfCrossReference​(int refnum, long offset)
      Constructs a cross-reference element for a PdfIndirectObject.
      PdfCrossReference​(int refnum, long offset, int generation)
      Constructs a cross-reference element for a PdfIndirectObject.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(PdfWriter.PdfBody.PdfCrossReference reference)
      Compares current entry with passed reference by PDF object number.
      boolean equals​(java.lang.Object obj)
      Checks if two entries are equal if their PDF object numbers are equal.
      (package private) int getRefnum()  
      int hashCode()  
      void toPdf​(int midSize, java.io.OutputStream os)
      Writes PDF syntax to the OutputStream
      void toPdf​(java.io.OutputStream os)
      Writes PDF representation of cross-reference entry to passed output stream.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CROSS_REFERENCE_ENTRY_FORMAT

        private static final java.lang.String CROSS_REFERENCE_ENTRY_FORMAT
        String template for cross-reference entry PDF representation.
        See Also:
        Formatter, Constant Field Values
      • type

        private final int type
      • offset

        private final long offset
        Byte offset in the PDF file.
      • refnum

        private final int refnum
      • generation

        private final int generation
        generation of the object.
    • Constructor Detail

      • PdfCrossReference

        public PdfCrossReference​(int refnum,
                                 long offset,
                                 int generation)
        Constructs a cross-reference element for a PdfIndirectObject.
        Parameters:
        refnum - the reference number
        offset - byte offset of the object
        generation - generation number of the object
      • PdfCrossReference

        public PdfCrossReference​(int refnum,
                                 long offset)
        Constructs a cross-reference element for a PdfIndirectObject.
        Parameters:
        refnum - the reference number
        offset - byte offset of the object
      • PdfCrossReference

        public PdfCrossReference​(int type,
                                 int refnum,
                                 long offset,
                                 int generation)
    • Method Detail

      • getRefnum

        int getRefnum()
      • toPdf

        public void toPdf​(java.io.OutputStream os)
                   throws java.io.IOException
        Writes PDF representation of cross-reference entry to passed output stream.
        Parameters:
        os - Output stream this entry to write to
        Throws:
        java.io.IOException - If any I/O error occurs
      • toPdf

        public void toPdf​(int midSize,
                          java.io.OutputStream os)
                   throws java.io.IOException
        Writes PDF syntax to the OutputStream
        Parameters:
        midSize - the mid size
        os - the OutputStream
        Throws:
        java.io.IOException - on error
      • equals

        public boolean equals​(java.lang.Object obj)
        Checks if two entries are equal if their PDF object numbers are equal.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Another cross-reference entry
        Returns:
        If null, not of type PdfWriter.PdfBody.PdfCrossReference or object numbers are not equal, returns false; true otherwise
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object