In encode methods, return a ptr_lib::shared_ptr<vector<unsigned char> >
diff --git a/ndn-cpp/ContentObject.hpp b/ndn-cpp/ContentObject.hpp
index 6bd5a80..794ef07 100644
--- a/ndn-cpp/ContentObject.hpp
+++ b/ndn-cpp/ContentObject.hpp
@@ -84,13 +84,13 @@
   
 class ContentObject {
 public:
-  void encode(std::vector<unsigned char> &output, WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > encode(WireFormat &wireFormat) const 
   {
-    wireFormat.encodeContentObject(*this, output);
+    return wireFormat.encodeContentObject(*this);
   }
-  void encode(std::vector<unsigned char> &output) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > encode() const 
   {
-    encode(output, BinaryXMLWireFormat::instance());
+    return encode(BinaryXMLWireFormat::instance());
   }
   void decode(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat) 
   {