Serializer improvements:

* Add getSlice()
* Make getVLDataLength public
This commit is contained in:
Vinnie Falco
2015-06-29 14:01:31 -07:00
parent bd7eb94d69
commit cb791482a0
2 changed files with 22 additions and 3 deletions

View File

@@ -575,6 +575,19 @@ int SerialIter::getVLDataLength ()
return datLen;
}
Slice
SerialIter::getSlice (std::size_t bytes)
{
if (bytes > remain_)
throw std::runtime_error(
"invalid SerialIter getSlice");
Slice s(p_, bytes);
p_ += bytes;
used_ += bytes;
remain_ -= bytes;
return s;
}
// VFALCO DEPRECATED Returns a copy
Blob
SerialIter::getVL()