void InFile::Read(BYTE *pbyBuffer, UINT32 nBytesToRead) const { UINT32 unBytesProcessed = 0; while (unBytesProcessed < nBytesToRead) { auto unBytesRead = ReadPart(pbyBuffer, nBytesToRead); if (!unBytesRead) { return; } pbyBuffer += unBytesRead; unBytesProcessed += unBytesRead; } }
bool CFile::Read(void *data, UInt32 size, UInt32 &processedSize) { processedSize = 0; do { UInt32 processedLoc = 0; bool res = ReadPart(data, size, processedLoc); processedSize += processedLoc; if (!res) return false; if (processedLoc == 0) return true; data = (void*)((unsigned char*)data + processedLoc); size -= processedLoc; } while (size > 0); }
HRESULT CLZMA::Read(void *data, UINT32 size, UINT32 *processedSize) { return ReadPart(data, size, processedSize); }
void CNetCacheAPI::ReadData(const string& key, string& buffer) { ReadPart(key, 0, 0, buffer); }