Package com.inet.pdfc.config
Class ArrayPdfSource
- java.lang.Object
-
- com.inet.pdfc.config.PdfSource
-
- com.inet.pdfc.config.ArrayPdfSource
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<PdfSource>
public class ArrayPdfSource extends PdfSource
This is aPdfSource
which is solely based on in-memory data.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.inet.pdfc.config.PdfSource
KEY_LAST_MODIFIED, KEY_NAME, KEY_PASSWORD, KEY_PATH, KEY_SIZE
-
-
Constructor Summary
Constructors Constructor Description ArrayPdfSource(java.lang.String name, long lastModified, byte[] content)
Creates thePdfSource
for in-memory data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.inet.persistence.RandomAccessRead
getContent()
Returns the readable content of this document sourcebyte[]
getRawContent()
Returns the binary content of thisPdfSource
long
getSize()
Returns the size of the raw data in bytes-
Methods inherited from class com.inet.pdfc.config.PdfSource
compareTo, equals, getLanguage, getLastModified, getMetaProperties, getName, getPassword, getPath, hashCode, setLanguage, setPageLimit, setPassword
-
-
-
-
Constructor Detail
-
ArrayPdfSource
public ArrayPdfSource(java.lang.String name, long lastModified, byte[] content)
Creates thePdfSource
for in-memory data.- Parameters:
name
- the name of the PDF, commonly the file name the PDF was read from, must not benull
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 comparisoncontent
- the actual raw content of the PDF, must not be null- Throws:
java.lang.IllegalArgumentException
- in case the name or the content isnull
- Since:
- 3.0
-
-
Method Detail
-
getSize
public long getSize()
Returns the size of the raw data in bytes
-
getRawContent
public byte[] getRawContent()
Returns the binary content of thisPdfSource
- 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 classPdfSource
- 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
-
-