Make Data content_ use a Blob.
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 68b4779..629ff37 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -72,7 +72,7 @@
dataStruct.contentLength = content_.size();
if (content_.size() > 0)
- dataStruct.content = (unsigned char *)&content_[0];
+ dataStruct.content = (unsigned char*)content_.buf();
else
dataStruct.content = 0;
}
@@ -82,7 +82,7 @@
signature_.set(dataStruct.signature);
name_.set(dataStruct.name);
metaInfo_.set(dataStruct.metaInfo);
- setVector(content_, dataStruct.content, dataStruct.contentLength);
+ content_ = Blob(dataStruct.content, dataStruct.contentLength);
}
}