other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +// OutStreamWithCRC.cpp
     1.5 +
     1.6 +#include "StdAfx.h"
     1.7 +
     1.8 +#include "OutStreamWithCRC.h"
     1.9 +
    1.10 +STDMETHODIMP COutStreamWithCRC::Write(const void *data, 
    1.11 +    UInt32 size, UInt32 *processedSize)
    1.12 +{
    1.13 +  UInt32 realProcessedSize;
    1.14 +  HRESULT result;
    1.15 +  if(!_stream)
    1.16 +  {
    1.17 +    realProcessedSize = size;
    1.18 +    result = S_OK;
    1.19 +  }
    1.20 +  else
    1.21 +    result = _stream->Write(data, size, &realProcessedSize);
    1.22 +  _crc.Update(data, realProcessedSize);
    1.23 +  if(processedSize != NULL)
    1.24 +    *processedSize = realProcessedSize;
    1.25 +  return result;
    1.26 +}

mercurial