9.04 beta

This commit is contained in:
Igor Pavlov
2009-06-02 00:00:00 +00:00
committed by Kornel Lesiński
parent 8874e4fbc9
commit 829409452d
440 changed files with 19803 additions and 9941 deletions

View File

@@ -2,10 +2,7 @@
#include "StdAfx.h"
extern "C"
{
#include "../../../C/Alloc.h"
}
#include "../Common/StreamUtils.h"
@@ -35,16 +32,18 @@ STDMETHODIMP CCopyCoder::Code(ISequentialInStream *inStream,
TotalSize = 0;
for (;;)
{
UInt32 realProcessedSize;
UInt32 size = kBufferSize;
if (outSize != 0)
if (size > *outSize - TotalSize)
size = (UInt32)(*outSize - TotalSize);
RINOK(inStream->Read(_buffer, size, &realProcessedSize));
if (realProcessedSize == 0)
RINOK(inStream->Read(_buffer, size, &size));
if (size == 0)
break;
RINOK(WriteStream(outStream, _buffer, realProcessedSize));
TotalSize += realProcessedSize;
if (outStream)
{
RINOK(WriteStream(outStream, _buffer, size));
}
TotalSize += size;
if (progress != NULL)
{
RINOK(progress->SetRatioInfo(&TotalSize, &TotalSize));
@@ -59,4 +58,10 @@ STDMETHODIMP CCopyCoder::GetInStreamProcessedSize(UInt64 *value)
return S_OK;
}
HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress)
{
CMyComPtr<ICompressCoder> copyCoder = new NCompress::CCopyCoder;
return copyCoder->Code(inStream, outStream, NULL, NULL, progress);
}
}