本文整理汇总了C++中nio::CInFile::ReadPart方法的典型用法代码示例。如果您正苦于以下问题:C++ CInFile::ReadPart方法的具体用法?C++ CInFile::ReadPart怎么用?C++ CInFile::ReadPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nio::CInFile
的用法示例。
在下文中一共展示了CInFile::ReadPart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteToStream
HRESULT CInOutTempBuffer::WriteToStream(ISequentialOutStream *stream)
{
if (!_outFile.Close())
return E_FAIL;
UInt64 size = 0;
UInt32 crc = CRC_INIT_VAL;
if (_bufPos > 0)
{
RINOK(WriteStream(stream, _buf, _bufPos));
crc = CrcUpdate(crc, _buf, _bufPos);
size += _bufPos;
}
if (_tempFileCreated)
{
NIO::CInFile inFile;
if (!inFile.Open(_tempFileName))
return E_FAIL;
while (size < _size)
{
UInt32 processed;
if (!inFile.ReadPart(_buf, kTempBufSize, processed))
return E_FAIL;
if (processed == 0)
break;
RINOK(WriteStream(stream, _buf, processed));
crc = CrcUpdate(crc, _buf, processed);
size += processed;
}
}
return (_crc == crc && size == _size) ? S_OK : E_FAIL;
}