X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Fpickle.hpp;h=60694fa83d92d8da1e9891e6865574d13d7e0ea2;hb=9840c201de08419f5d940642974438917a44d849;hp=736025b2a1cd8b3ee6583e8bfac336b30edad876;hpb=b16a4a88f021ec70cae2fc6278c2bd25224681a8;p=apitrace diff --git a/common/pickle.hpp b/common/pickle.hpp index 736025b..60694fa 100644 --- a/common/pickle.hpp +++ b/common/pickle.hpp @@ -268,6 +268,16 @@ public: os.put(u.c[0]); } + inline void writeByteArray(const void *buf, size_t length) { + os.put(GLOBAL); + os << "__builtin__\nbytearray\n"; + os.put(BINPUT); + os.put(1); + writeString(static_cast(buf), length); + os.put(TUPLE1); + os.put(REDUCE); + } + protected: inline void putInt16(uint16_t i) { os.put( i & 0xff);