There seem to be issues with Base64 encoding if the payloads get somewhat large.
Here is an example that reproduces this, it works if the payload is smaller, say 200000000 bytes. But if you increase it to 300000000 it will fail.
MemoryBlock payload(300000000, true); //change it to 200000000 and it works, but 300000000 causes the problem
String plainString = payload.toBase64Encoding();
MemoryOutputStream stream;
stream.writeString(plainString);
stream.flush();
MemoryBlock plaintext = stream.getMemoryBlock();
String b64 = plaintext.toBase64Encoding();
MemoryBlock decoded;
decoded.fromBase64Encoding(b64);
if (plaintext != decoded)
std::cout << "not matching" << std::endl;
else
std::cout << "match" << std::endl;
