Files
easy7zip/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.cpp
Igor Pavlov d9666cf046 4.44 beta
2016-05-28 00:15:49 +01:00

28 lines
533 B
C++
Executable File

// LzhOutStreamWithCRC.cpp
#include "StdAfx.h"
#include "LzhOutStreamWithCRC.h"
namespace NArchive {
namespace NLzh {
STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize;
HRESULT result;
if(!_stream)
{
realProcessedSize = size;
result = S_OK;
}
else
result = _stream->Write(data, size, &realProcessedSize);
_crc.Update(data, realProcessedSize);
if(processedSize != NULL)
*processedSize = realProcessedSize;
return result;
}
}}