First Commit after cleanup
Socket Bridge in java now works with UDP
Now connecting to remote ccnd nodes ( unless there is a firewall on the
way) currently connecting to borges on port 9695
Cleaned up the code and added authors to all files since new people are
joining the project.
Separated java from javascript code.
diff --git a/js/encoding/TextXMLCodec.js b/js/encoding/TextXMLCodec.js
new file mode 100644
index 0000000..716aa6d
--- /dev/null
+++ b/js/encoding/TextXMLCodec.js
@@ -0,0 +1,59 @@
+//TODO INCOMPLETE
+/*
+ * @author: ucla-cs
+ *
+ * Encodes CCN object into xml tags
+ */
+var DataUtils = require('./DataUtils').DataUtils;
+
+ var /*DateFormat*/ canonicalWriteDateFormat = null;
+ var /* DateFormat*/ canonicalReadDateFormat = null;
+ var /*String*/ PAD_STRING = "000000000";
+ var /*int*/ NANO_LENGTH = 9;
+
+var TextXMLCodec = function TextXMLCodec(){
+
+ this.CCN_NAMESPACE = "http://www.parc.com/ccn"; // String
+ this.CCN_PREFIX = "ccn"; // String
+ this.CODEC_NAME = "Text";// String
+ this.BINARY_ATTRIBUTE = "ccnbencoding";// String
+ this.BINARY_ATTRIBUTE_VALUE = "base64Binary";// String
+
+
+};
+
+//returns a string
+
+TextXMLCodec.protpotype.codecName = function() { return this.CODEC_NAME; } ;
+
+//returns a string
+TextXMLCodec.protottype.encodeBinaryElement = function(/*byte []*/ element) {
+ if ((null == element) || (0 == element.length))
+ return new String("");
+ return new String(DataUtils.base64Encode(element));
+ };
+
+/* returns a string */
+TextXMLCodec.prototype.encodeBinaryElement = function(/*byte []*/ element, /*int*/ offset, /*int*/ length) {
+ if ((null == element) || (0 == element.length))
+ return new String("");
+ ByteBuffer bbuf = ByteBuffer.wrap(element, offset, length);
+ return new String(DataUtils.base64Encode(bbuf.array()));
+ };
+
+/*returns a byte array*/
+TextXMLCodec.prototype.decodeBinaryElement = function(/*String*/ element) {
+ if ((null == element) || (0 == element.length()))
+ return new byte[0];
+ return DataUtils.base64Decode(element.getBytes());
+ };
+
+
+/*
+ Decode Data
+*/
+
+
+/*
+ Encode Date
+*/
\ No newline at end of file