本文整理汇总了C++中MemoryOutputStream::getMemoryBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryOutputStream::getMemoryBlock方法的具体用法?C++ MemoryOutputStream::getMemoryBlock怎么用?C++ MemoryOutputStream::getMemoryBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryOutputStream
的用法示例。
在下文中一共展示了MemoryOutputStream::getMemoryBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
void OnlineUnlockStatus::save()
{
MemoryOutputStream mo;
{
GZIPCompressorOutputStream gzipStream (&mo, 9);
status.writeToStream (gzipStream);
}
saveState (mo.getMemoryBlock().toBase64Encoding());
}
示例2: encryptXML
//==============================================================================
static String encryptXML (const XmlElement& xml, RSAKey privateKey)
{
MemoryOutputStream text;
text << xml.createDocument (StringRef(), true);
BigInteger val;
val.loadFromMemoryBlock (text.getMemoryBlock());
privateKey.applyToValue (val);
return val.toString (16);
}
示例3: createRequestHeader
static MemoryBlock createRequestHeader (const String& hostName, const int hostPort,
const String& proxyName, const int proxyPort,
const String& hostPath, const String& originalURL,
const String& userHeaders, const MemoryBlock& postData,
const bool isPost)
{
MemoryOutputStream header;
if (proxyName.isEmpty())
writeHost (header, isPost, hostPath, hostName, hostPort);
else
writeHost (header, isPost, originalURL, proxyName, proxyPort);
writeValueIfNotPresent (header, userHeaders, "User-Agent:", "JUCE/" JUCE_STRINGIFY(JUCE_MAJOR_VERSION)
"." JUCE_STRINGIFY(JUCE_MINOR_VERSION)
"." JUCE_STRINGIFY(JUCE_BUILDNUMBER));
writeValueIfNotPresent (header, userHeaders, "Connection:", "Close");
writeValueIfNotPresent (header, userHeaders, "Content-Length:", String ((int) postData.getSize()));
header << "\r\n" << userHeaders
<< "\r\n" << postData;
return header.getMemoryBlock();
}
示例4: valueTreeToMemoryBlock
static MemoryBlock valueTreeToMemoryBlock (const ValueTree& v)
{
MemoryOutputStream mo;
v.writeToStream (mo);
return mo.getMemoryBlock();
}