Class ArrayPdfSource

java.lang.Object
com.inet.pdfc.config.PdfSource
com.inet.pdfc.config.ArrayPdfSource
All Implemented Interfaces:
Serializable, Comparable<PdfSource>

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

    • ArrayPdfSource

      public ArrayPdfSource(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:
      IllegalArgumentException - in case the name or the content is null
      Since:
      3.0
  • Method Details

    • 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 IOException
      Returns the readable content of this document source
      Specified by:
      getContent in class PdfSource
      Returns:
      the readable content of this document source
      Throws:
      IOException - thrown in case the source data cannot be accessed or does not exist