encoding: Optimized Data packet encoding, preparation for memory-efficient signing operation

Change-Id: I6eb1f8acef917970790d1f228ade6212c45181fa
refs: #1172
diff --git a/src/encoding/encoding-buffer.hpp b/src/encoding/encoding-buffer.hpp
index 7385c65..c9abd31 100644
--- a/src/encoding/encoding-buffer.hpp
+++ b/src/encoding/encoding-buffer.hpp
@@ -523,7 +523,7 @@
 
 template<bool P, class U>
 inline size_t
-prependNestedBlock(EncodingImpl<P>& blk, uint32_t type, U& nestedBlock)
+prependNestedBlock(EncodingImpl<P>& blk, uint32_t type, const U& nestedBlock)
 {
   size_t var_len = nestedBlock.wireEncode(blk);
   size_t total_len = var_len;
@@ -533,6 +533,13 @@
   return total_len;
 }
 
+template<bool P>
+inline size_t
+prependBlock(EncodingImpl<P>& blk, const Block& block)
+{
+  return blk.prependByteArray(block.wire(), block.size());
+}
+
 
 } // ndn