view src/win32/7zip/7z/CPP/7zip/Archive/Lzh/LzhOutStreamWithCRC.cpp @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line source
1 // LzhOutStreamWithCRC.cpp
3 #include "StdAfx.h"
5 #include "LzhOutStreamWithCRC.h"
7 namespace NArchive {
8 namespace NLzh {
10 STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
11 {
12 UInt32 realProcessedSize;
13 HRESULT result;
14 if(!_stream)
15 {
16 realProcessedSize = size;
17 result = S_OK;
18 }
19 else
20 result = _stream->Write(data, size, &realProcessedSize);
21 _crc.Update(data, realProcessedSize);
22 if(processedSize != NULL)
23 *processedSize = realProcessedSize;
24 return result;
25 }
27 }}