标签:std stream config ref write read string 比较 rap
有个需求需要将二进制istream上传到s3上暂存,但苦于没能直接找到接口,官方提供的设置数据块的接口如下:
<<或>>函数,需要使用std::stringstream::read和std::stringstream::write函数。std::shared_ptr<Aws::StringStream> input_data =
Aws::MakeShared<Aws::StringStream>("");
input_data->write(buffer.data(),srcSize);
S3ClientWrapper *client = new S3ClientWrapper();
std::string endpoint = "";
ngmp::common::aws_client_configuration_info_struct config;
client->Init(config);
std::string errinfo;
Aws::S3::S3Errors error_code;
bool res = client->PutObject("bucket","object-name",input_data,errinfo, error_code,10);
上面的代码包含了一部分aws sdk的封装代码,仅供参考。
aws s3 上传 binary 数据 (通过stringstream)
标签:std stream config ref write read string 比较 rap
原文地址:https://www.cnblogs.com/J1ac/p/12207253.html