Added blob.hpp
diff --git a/Makefile.am b/Makefile.am
index 482330f..74c3b04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,6 +65,7 @@
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
+ ndn-cpp/util/blob.hpp \
ndn-cpp/util/dynamic-uchar-vector.cpp ndn-cpp/util/dynamic-uchar-vector.hpp
bin_test_encode_decode_forwarding_entry_SOURCES = tests/test-encode-decode-forwarding-entry.cpp
diff --git a/Makefile.in b/Makefile.in
index 6ffc09d..6938b1b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -521,6 +521,7 @@
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/tcp-transport.h ndn-cpp/transport/tcp-transport.cpp ndn-cpp/transport/tcp-transport.hpp \
ndn-cpp/transport/transport.cpp ndn-cpp/transport/transport.hpp \
ndn-cpp/c/transport/socket-transport.h ndn-cpp/c/transport/udp-transport.h ndn-cpp/transport/udp-transport.cpp ndn-cpp/transport/udp-transport.hpp \
+ ndn-cpp/util/blob.hpp \
ndn-cpp/util/dynamic-uchar-vector.cpp ndn-cpp/util/dynamic-uchar-vector.hpp
bin_test_encode_decode_forwarding_entry_SOURCES = tests/test-encode-decode-forwarding-entry.cpp
diff --git a/libtool b/libtool
index 0331b3e..53320ed 100755
--- a/libtool
+++ b/libtool
@@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (ndn-cpp) 0.5
-# Libtool was configured on host Jeffs-MacBook-Pro.local:
+# Libtool was configured on host toro.remap.ucla.edu:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
diff --git a/ndn-cpp/util/blob.hpp b/ndn-cpp/util/blob.hpp
new file mode 100644
index 0000000..ed28fe5
--- /dev/null
+++ b/ndn-cpp/util/blob.hpp
@@ -0,0 +1,77 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_BLOB_HPP
+#define NDN_BLOB_HPP
+
+#include "../common.hpp"
+
+namespace ndn {
+
+/**
+ * A Blob holds a pointer to an immutable byte array.
+ */
+class Blob {
+public:
+ /**
+ * Create a new Blob with an immutable copy of the given array.
+ * @param value A pointer to the byte array which is copied.
+ * @param valueLength The length of value.
+ */
+ Blob(const unsigned char* value, unsigned int valueLength)
+ : value_(new std::vector<unsigned char>(value, value + valueLength))
+ {
+ }
+
+ /**
+ * Create a new Blob with an immutable copy of the array in the given vector.
+ * @param value A reference to a vector which is copied.
+ */
+ Blob(const std::vector<unsigned char> &value)
+ : value_(new std::vector<unsigned char>(value))
+ {
+ }
+
+ /**
+ * Create a new Blob to point to an existing byte array. IMPORTANT: After calling this constructor,
+ * you must treat the array as immutable and promise not to change it.
+ * @param value A pointer to a vector with the byte array. This takes another reference and does not copy the bytes.
+ */
+ Blob(const ptr_lib::shared_ptr<std::vector<unsigned char> > &value)
+ : value_(value)
+ {
+ }
+
+ /**
+ * Return a const reference to the immutable byte array.
+ */
+ const std::vector<unsigned char>& getValue() const
+ {
+ return *value_;
+ }
+
+ /**
+ * Return the length of the immutable byte array.
+ */
+ unsigned int size() const
+ {
+ return value_->size();
+ }
+
+ /**
+ * Get const pointer to the first byte of the immutable byte array.
+ */
+ const unsigned char* buffer() const
+ {
+ return &value_->front ();
+ }
+
+private:
+ ptr_lib::shared_ptr<std::vector<unsigned char> > value_;
+};
+
+}
+
+#endif