Class ArrayPdfSource

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PdfSource>

    public class ArrayPdfSource
    extends PdfSource
    This is a PdfSource which is solely based on in-memory data.
    See Also:
    Serialized Form
    • Constructor Detail

      • ArrayPdfSource

        public ArrayPdfSource​(java.lang.String name,
                              long lastModified,
                              byte[] content)
        Creates the PdfSource for in-memory data.
        Parameters:
        name - the name of the PDF, commonly the file name the PDF was read from, must not be null
        lastModified - the last modified timestamp of the PDF data; this time stamp is only relevant for the result export, it's not used in the comparison
        content - the actual raw content of the PDF, must not be null
        Throws:
        java.lang.IllegalArgumentException - in case the name or the content is null
        Since:
        3.0
    • Method Detail

      • getSize

        public long getSize()
        Returns the size of the raw data in bytes
        Overrides:
        getSize in class PdfSource
        Returns:
        the size of the raw data in bytes
      • getRawContent

        public byte[] getRawContent()
        Returns the binary content of this PdfSource
        Returns:
        the binary content of this PdfSource
        Since:
        3.0
      • getContent

        public com.inet.persistence.RandomAccessRead getContent()
                                                         throws java.io.IOException
        Returns the readable content of this document source
        Specified by:
        getContent in class PdfSource
        Returns:
        the readable content of this document source
        Throws:
        java.io.IOException - thrown in case the source data cannot be accessed or does not exist