aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/framework')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/framework/input/DataSource.java15
-rw-r--r--src/main/java/at/gv/egiz/pdfas/framework/output/DataSink.java4
2 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/framework/input/DataSource.java b/src/main/java/at/gv/egiz/pdfas/framework/input/DataSource.java
index 265cb0c..fcf55b8 100644
--- a/src/main/java/at/gv/egiz/pdfas/framework/input/DataSource.java
+++ b/src/main/java/at/gv/egiz/pdfas/framework/input/DataSource.java
@@ -32,4 +32,19 @@ public interface DataSource
*/
public int getLength();
+ /**
+ * Returns the data of this DataSource as a byte array.
+ *
+ * <p>
+ * Calling this method indicates that you need a byte array for random <strong>read</strong> access.
+ * The DataSource implementation should of course cache this byte array to avoid too much memory usage.
+ * </p>
+ * <p>
+ * Performance analysis has shown that the libraries internally convert the streams to byte arrays and
+ * that file system access is very slow.
+ * </p>
+ *
+ * @return
+ */
+ public byte [] getAsByteArray();
}
diff --git a/src/main/java/at/gv/egiz/pdfas/framework/output/DataSink.java b/src/main/java/at/gv/egiz/pdfas/framework/output/DataSink.java
index d7d0cc4..595df52 100644
--- a/src/main/java/at/gv/egiz/pdfas/framework/output/DataSink.java
+++ b/src/main/java/at/gv/egiz/pdfas/framework/output/DataSink.java
@@ -12,4 +12,8 @@ public interface DataSink
public OutputStream createOutputStream(String mimeType);
public OutputStream createOutputStream(String mimeType, String characterEncoding);
+
+ public String getMimeType();
+
+ public String getCharacterEncoding();
}