6 #include "../IStream.h"
7 #include "../../Common/MyCom.h"
8 #include "../../Common/MyException.h"
10 #ifndef _NO_EXCEPTIONS
11 struct COutBufferException: public CSystemException
13 COutBufferException(HRESULT errorCode): CSystemException(errorCode) {}
25 CMyComPtr<ISequentialOutStream> _stream;
26 UInt64 _processedSize;
36 COutBuffer(): _buffer(0), _pos(0), _stream(0), _buffer2(0) {}
37 ~COutBuffer() { Free(); }
39 bool Create(UInt32 bufferSize);
42 void SetMemStream(Byte *buffer) { _buffer2 = buffer; }
43 void SetStream(ISequentialOutStream *stream);
46 void FlushWithCheck();
47 void ReleaseStream() { _stream.Release(); }
49 void WriteByte(Byte b)
55 void WriteBytes(const void *data, size_t size)
57 for (size_t i = 0; i < size; i++)
58 WriteByte(((const Byte *)data)[i]);
61 UInt64 GetProcessedSize() const;