只看了int类型的序列化,后面的有时间再研究
#include <vector> #include <iostream> int main() { int value = 1024; while (true) { if ((value & ~0x7F) == 0) { std::cout << value << std::endl; break; } else { std::cout << ((value & 0x7F) | 0x80)<< std::endl; value >>= 7; } } getchar(); return 0; }
原文:https://www.cnblogs.com/zzyoucan/p/9194285.html