Change wire encoding to return a Blob.
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index ad87674..bca4507 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -148,7 +148,7 @@
   {
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
+  Blob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
   {
     return wireFormat.encodeData(*this);
   }
@@ -200,7 +200,15 @@
   { 
     content_ = Blob(content, contentLength); 
   }
-    
+      
+  /**
+   * Set content to point to an existing byte array.  IMPORTANT: After calling this,
+   * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
+   * @param content A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
+   */
+  void setContent(const ptr_lib::shared_ptr<std::vector<unsigned char> > &content) { content_ = content; }
+  void setContent(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &content) { content_ = content; }
+
 private:
   Signature signature_;
   Name name_;
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 2bb2093..39f7b4a 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -24,7 +24,7 @@
   return new BinaryXmlWireFormat();
 }
   
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeInterest(const Interest& interest) 
+Blob BinaryXmlWireFormat::encodeInterest(const Interest& interest) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -59,8 +59,7 @@
   interest.set(interestStruct);
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeData
-  (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+Blob BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -96,7 +95,7 @@
   data.set(dataStruct);
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
+Blob BinaryXmlWireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index aca140d..6647566 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -19,9 +19,9 @@
   /**
    * Encode interest in binary XML and return the encoding.
    * @param interest The Interest object to encode.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    */  
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest& interest);
+  virtual Blob encodeInterest(const Interest& interest);
     
   /**
    * Decode input as an interest in binary XML and set the fields of the interest object.
@@ -38,9 +38,9 @@
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
+  virtual Blob encodeData
     (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
   
   /**
@@ -61,9 +61,9 @@
   /**
    * Encode forwardingEntry in binary XML and return the encoding. 
    * @param forwardingEntry The ForwardingEntry object to encode.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
+  virtual Blob encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
   
   /**
    * Decode input as a forwarding entry in binary XML and set the fields of the forwardingEntry object. 
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index e0a4fc0..ced4c18 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -26,7 +26,7 @@
   return defaultWireFormat_;
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeInterest(const Interest& interest) 
+Blob WireFormat::encodeInterest(const Interest& interest) 
 {
   throw logic_error("unimplemented");
 }
@@ -35,8 +35,7 @@
   throw logic_error("unimplemented");
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeData
-  (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+Blob WireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
 {
   throw logic_error("unimplemented");
 }
@@ -46,7 +45,7 @@
   throw logic_error("unimplemented");
 }
 
-ptr_lib::shared_ptr<vector<unsigned char> > WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
+Blob WireFormat::encodeForwardingEntry(const ForwardingEntry& forwardingEntry) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index b0b2ea4..575b441 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -7,7 +7,7 @@
 #define NDN_WIREFORMAT_HPP
 
 #include "../common.hpp"
-#include <vector>
+#include "../util/blob.hpp"
 
 namespace ndn {
   
@@ -20,10 +20,10 @@
   /**
    * Encode interest and return the encoding.  Your derived class should override.
    * @param interest The Interest object to encode.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeInterest(const Interest& interest);
+  virtual Blob encodeInterest(const Interest& interest);
   
   /**
    * Decode input as an interest and set the fields of the interest object.  Your derived class should override.
@@ -41,19 +41,19 @@
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData
+  virtual Blob encodeData
     (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
 
   /**
    * Encode data and return the encoding.
    * @param data The Data object to encode.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  ptr_lib::shared_ptr<std::vector<unsigned char> > encodeData(const Data& data)
+  Blob encodeData(const Data& data)
   {
     unsigned int dummyBeginOffset, dummyEndOffset;
     return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
@@ -84,10 +84,10 @@
   /**
    * Encode forwardingEntry and return the encoding.  Your derived class should override.
    * @param forwardingEntry The ForwardingEntry object to encode.
-   * @return A shared_ptr with the vector<unsigned char> containing the encoding.
+   * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
-  virtual ptr_lib::shared_ptr<std::vector<unsigned char> > encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
+  virtual Blob encodeForwardingEntry(const ForwardingEntry& forwardingEntry);
   
   /**
    * Decode input as a forwarding entry and set the fields of the forwardingEntry object.  Your derived class should override.
diff --git a/ndn-cpp/forwarding-entry.hpp b/ndn-cpp/forwarding-entry.hpp
index 9919f49..177e5c4 100644
--- a/ndn-cpp/forwarding-entry.hpp
+++ b/ndn-cpp/forwarding-entry.hpp
@@ -31,30 +31,18 @@
   {
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat) const 
+  Blob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
   {
     return wireFormat.encodeForwardingEntry(*this);
   }
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode() const 
-  {
-    return wireEncode(*WireFormat::getDefaultWireFormat());
-  }
-  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat) 
+  void wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeForwardingEntry(*this, input, inputLength);
   }
-  void wireDecode(const unsigned char *input, unsigned int inputLength) 
-  {
-    wireDecode(input, inputLength, *WireFormat::getDefaultWireFormat());
-  }
-  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat) 
+  void wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
-  void wireDecode(const std::vector<unsigned char>& input) 
-  {
-    wireDecode(&input[0], input.size());
-  }
   
   /**
    * Set the forwardingEntryStruct to point to the components in this forwarding entry, without copying any memory.
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index 50baaa4..bd7991f 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -159,7 +159,7 @@
     construct();
   }
   
-  ptr_lib::shared_ptr<std::vector<unsigned char> > wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
+  Blob wireEncode(WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) const 
   {
     return wireFormat.encodeInterest(*this);
   }
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index 9f4f30e..b28cd33 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -60,7 +60,7 @@
   }
   
   /**
-   * Set keyData to point to an existing byte array.  IMPORTANT: After calling this constructor,
+   * Set keyData to point to an existing byte array.  IMPORTANT: After calling this,
    * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
    * @param keyData A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 7fb34fd..2170fe9 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -37,7 +37,7 @@
   
   pit_.push_back(shared_ptr<PitEntry>(new PitEntry(shared_ptr<const Interest>(new Interest(interest)), onData, onTimeout)));
   
-  shared_ptr<vector<unsigned char> > encoding = interest.wireEncode();  
+  Blob encoding = interest.wireEncode();  
   transport_->send(*encoding);
 }
 
@@ -73,15 +73,15 @@
 {
   // Create a ForwardingEntry.
   ForwardingEntry forwardingEntry("selfreg", prefix, PublisherPublicKeyDigest(), -1, 3, 2147483647);
-  ptr_lib::shared_ptr<vector<unsigned char> > content = forwardingEntry.wireEncode();
+  Blob content = forwardingEntry.wireEncode();
 
   // Set the ForwardingEntry as the content of a Data packet and sign.
   Data data;
-  data.setContent(*content);
+  data.setContent(content);
   data.getMetaInfo().setTimestampMilliseconds(time(NULL) * 1000.0);
   // TODO: Should we sign with a different key?
   KeyChain::defaultSign(data);
-  ptr_lib::shared_ptr<vector<unsigned char> > encodedData = data.wireEncode();
+  Blob encodedData = data.wireEncode();
   
   // Create an interest where the name has the encoded Data packet.
   Name interestName;
@@ -90,11 +90,11 @@
   interestName.addComponent(component0, sizeof(component0) - 1);
   interestName.addComponent(ndndId_);
   interestName.addComponent(component2, sizeof(component2) - 1);
-  interestName.addComponent(*encodedData);
+  interestName.addComponent(encodedData);
   
   Interest interest(interestName);
   interest.setScope(1);
-  ptr_lib::shared_ptr<vector<unsigned char> > encodedInterest = interest.wireEncode();
+  Blob encodedInterest = interest.wireEncode();
   
   // Save the onInterest callback and send the registration interest.
   registeredPrefixTable_.push_back(shared_ptr<PrefixEntry>(new PrefixEntry(shared_ptr<const Name>(new Name(prefix)), onInterest)));
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 5ba46ba..ba36071 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -67,9 +67,9 @@
 static void digestDataFieldsSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
 {
   unsigned int signedFieldsBeginOffset, signedFieldsEndOffset;
-  ptr_lib::shared_ptr<vector<unsigned char> > encoding = wireFormat.encodeData(data, &signedFieldsBeginOffset, &signedFieldsEndOffset);
+  Blob encoding = wireFormat.encodeData(data, &signedFieldsBeginOffset, &signedFieldsEndOffset);
   
-  ndn_digestSha256(&encoding->front() + signedFieldsBeginOffset, signedFieldsEndOffset - signedFieldsBeginOffset, digest);
+  ndn_digestSha256(encoding.buf() + signedFieldsBeginOffset, signedFieldsEndOffset - signedFieldsBeginOffset, digest);
 }
 
 void KeyChain::sign