Add getRaw for vector and addZeros to Serializer.

This commit is contained in:
Arthur Britto
2012-05-19 18:15:12 -07:00
parent a823aa950e
commit 230ee34b24
2 changed files with 22 additions and 0 deletions

View File

@@ -4,6 +4,16 @@
#include <openssl/ripemd.h>
#include <openssl/sha.h>
int Serializer::addZeros(size_t uBytes)
{
int ret = mData.size();
while (uBytes--)
mData.push_back(0);
return ret;
}
int Serializer::add16(uint16 i)
{
int ret = mData.size();
@@ -574,4 +584,13 @@ std::vector<TaggedListItem> SerializerIterator::getTaggedList()
mPos += length;
return tl;
}
std::vector<unsigned char> SerializerIterator::getRaw(int iLength)
{
int iPos = mPos;
mPos += iLength;
return mSerializer.getRaw(iPos, iLength);
}
// vim:ts=4