class CachedOutputStream
{ /// When buffer hits this size, it's written to mxOutputStream staticconst sal_Int32 mnMaximumSize = 0x100000; // 1Mbyte
/// ForMerge structure is used for sorting elements in Writer
std::shared_ptr< ForMergeBase > mpForMerge; const Int8Sequence maCache; /// Output stream, usually writing data into files.
css::uno::Reference< css::io::XOutputStream > mxOutputStream;
uno_Sequence *pSeq;
sal_Int32 mnCacheWrittenSize; bool mbWriteToOutStream;
/// cache string and if limit is hit, flush void writeBytes( const sal_Int8* pStr, sal_Int32 nLen )
{ // Write when the buffer gets big enough if (mnCacheWrittenSize + nLen > mnMaximumSize)
{
flush();
// Writer does some elements sorting, so it can accumulate // pretty big strings in FastSaxSerializer::ForMerge. // In that case, just flush data and write immediately. if (nLen > mnMaximumSize)
{ if (mbWriteToOutStream)
mxOutputStream->writeBytes( css::uno::Sequence<sal_Int8>(pStr, nLen) ); else
mpForMerge->append( Int8Sequence(pStr, nLen) ); return;
}
}
/// immediately write buffer into mxOutputStream and clear void flush()
{ // resize the Sequence to written size
pSeq->nElements = mnCacheWrittenSize; if (mbWriteToOutStream)
mxOutputStream->writeBytes( css::uno::toUnoSequence(maCache) ); else
mpForMerge->append( maCache ); // and next time write to the beginning
mnCacheWrittenSize = 0;
}
};
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.