34 std::vector<unsigned char>
in;
38 in.push_back((
unsigned char)
c);
46 uLongf destLen = compressBound(
in.size());
47 int zerr = compress2(&*
blob.begin(), &destLen, &*
in.begin(),
in.size(), 9);
55 blob.push_back((
unsigned char)
c);
63 std::vector<unsigned char>
out(
isize);
64 uLongf destLen =
out.size();
65 int zerr = uncompress(&*
out.begin(), &destLen, &*
blob.begin(),
blob.size());
66 if (
zerr != 0 ||
out.size() != destLen)
67 edm::LogError(
"FileBlob") <<
"uncompressing error " <<
zerr <<
" original size was " <<
isize <<
" new size is "
69 os.write(reinterpret_cast<const char*>(&*
out.begin()),
out.size());
71 os.write(reinterpret_cast<const char*>(&*
blob.begin()),
blob.size());
76 std::unique_ptr<std::vector<unsigned char>> newblob;
78 newblob = std::make_unique<std::vector<unsigned char>>(
isize);
79 uLongf destLen = newblob->size();
81 int zerr = uncompress(&*(newblob->begin()), &destLen, &*
blob.begin(),
blob.size());
82 if (
zerr != 0 || newblob->size() != destLen)
83 edm::LogError(
"FileBlob") <<
"uncompressing error " <<
zerr <<
" original size was " <<
isize <<
" new size is "
86 newblob = std::make_unique<std::vector<unsigned char>>(
blob);
93 myblobcopy.reserve(
isize);
94 uLongf destLen =
isize;
95 int zerr = uncompress(&*myblobcopy.begin(), &destLen, &*
blob.begin(),
blob.size());
96 if (
zerr != 0 || myblobcopy.size() != destLen)
97 edm::LogError(
"FileBlob") <<
"uncompressing error " <<
zerr <<
" original size was " <<
isize <<
" new size is "