In encode methods, return a ptr_lib::shared_ptr<vector<unsigned char> >
diff --git a/ndn-cpp/Interest.hpp b/ndn-cpp/Interest.hpp
index 61d2510..76f3c17 100644
--- a/ndn-cpp/Interest.hpp
+++ b/ndn-cpp/Interest.hpp
@@ -129,13 +129,13 @@
   	construct();
   }
   
-  void encode(std::vector<unsigned char> &output, WireFormat &wireFormat) const 
+  ptr_lib::shared_ptr<std::vector<unsigned char> > encode(WireFormat &wireFormat) const 
   {
-    wireFormat.encodeInterest(*this, output);
+    return wireFormat.encodeInterest(*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) 
   {