summaryrefslogtreecommitdiff
path: root/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-17 17:17:10 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-09-17 17:17:10 +0000
commitcf82096145bbdd548e388c1bc25f0e703b9b4624 (patch)
treeae08e610926dd5d5fa1b15df2856427df3e10060 /BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl
parent6cafec9a3f05bb5e24c364e51a336326a63b8296 (diff)
downloadmocca-cf82096145bbdd548e388c1bc25f0e703b9b4624.tar.gz
mocca-cf82096145bbdd548e388c1bc25f0e703b9b4624.tar.bz2
mocca-cf82096145bbdd548e388c1bc25f0e703b9b4624.zip
hashdatainput digest verification
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@44 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl')
-rw-r--r--BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
new file mode 100644
index 00000000..b0285345
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
@@ -0,0 +1,58 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package at.gv.egiz.stal.impl;
+
+import at.gv.egiz.stal.HashDataInput;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+/**
+ *
+ * @author clemens
+ */
+public class ByteArrayHashDataInput implements HashDataInput {
+
+ protected byte[] hashData;
+ protected String id;
+ protected String mimeType;
+ protected String encoding;
+
+ public ByteArrayHashDataInput(byte[] hashData, String id, String mimeType, String encoding) {
+ if (hashData == null) {
+ throw new NullPointerException("HashDataInput not provided.");
+ }
+ this.hashData = hashData;
+ this.id = id;
+ this.mimeType = mimeType;
+ this.encoding = encoding;
+ }
+
+ @Override
+ public String getReferenceId() {
+ return id;
+ }
+
+ @Override
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ @Override
+ public InputStream getHashDataInput() {
+ return new ByteArrayInputStream(hashData);
+ }
+
+ /**
+ * may be null
+ * @return
+ */
+ @Override
+ public String getEncoding() {
+ return encoding;
+ }
+
+
+}