summaryrefslogtreecommitdiffstats
path: root/src/libs/7zip/unix/CPP/7zip/Archive/Common/OutStreamWithSha1.cpp
blob: 0526c1b1d2c517ce231f4250642676d48f8e962d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// OutStreamWithSha1.cpp

#include "StdAfx.h"

#include "OutStreamWithSha1.h"

STDMETHODIMP COutStreamWithSha1::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
  HRESULT result = S_OK;
  if (_stream)
    result = _stream->Write(data, size, &size);
  if (_calculate)
    _sha.Update((const Byte *)data, size);
  _size += size;
  if (processedSize != NULL)
    *processedSize = size;
  return result;
}