From 71478fd62d8483483abb34609cdabb7f9cbadfd6 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Dec 2015 14:18:43 +0000 Subject: Add hostTools from https://github.com/Noltari/cfe_bcm63xx --- hostTools/lzma/compress/IInOutStreams.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hostTools/lzma/compress/IInOutStreams.cpp (limited to 'hostTools/lzma/compress/IInOutStreams.cpp') diff --git a/hostTools/lzma/compress/IInOutStreams.cpp b/hostTools/lzma/compress/IInOutStreams.cpp new file mode 100644 index 0000000..73bd1e0 --- /dev/null +++ b/hostTools/lzma/compress/IInOutStreams.cpp @@ -0,0 +1,25 @@ +#include "Portable.h" +#include "IInOutStreams.h" + +HRESULT ISequentialInStream::Read(void *aData, UINT32 aSize, UINT32* aProcessedSize) { + if (aSize > size) + aSize = size; + *aProcessedSize = aSize; + memcpy(aData, data, aSize); + size -= aSize; + data += aSize; + return S_OK; +} + +HRESULT ISequentialOutStream::Write(const void *aData, UINT32 aSize, UINT32* aProcessedSize) { + if (aSize > size) { + overflow = true; + aSize = size; + } + *aProcessedSize = aSize; + memcpy(data, aData, aSize); + size -= aSize; + data += aSize; + total += aSize; + return S_OK; +} -- cgit v1.2.3