6 #include "../IStream.h"
7 #include "../../Common/MyCom.h"
10 struct COutBufferException
13 COutBufferException(HRESULT errorCode
): ErrorCode(errorCode
) {}
25 CMyComPtr
<ISequentialOutStream
> _stream
;
26 UInt64 _processedSize
;
31 void FlushWithCheck();
37 COutBuffer(): _buffer(0), _pos(0), _stream(0), _buffer2(0) {}
38 ~COutBuffer() { Free(); }
40 bool Create(UInt32 bufferSize
);
43 void SetMemStream(Byte
*buffer
) { _buffer2
= buffer
; }
44 void SetStream(ISequentialOutStream
*stream
);
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;