1 // CabBlockInStream.h 2 3 #ifndef ZIP7_INC_CAB_BLOCK_IN_STREAM_H 4 #define ZIP7_INC_CAB_BLOCK_IN_STREAM_H 5 6 #include "../../IStream.h" 7 8 namespace NArchive { 9 namespace NCab { 10 11 class CBlockPackData 12 { 13 Byte *_buf; 14 UInt32 _size; 15 public: CBlockPackData()16 CBlockPackData(): _buf(NULL), _size(0) {} 17 ~CBlockPackData() throw(); 18 bool Create() throw(); InitForNewBlock()19 void InitForNewBlock() { _size = 0; } 20 HRESULT Read(ISequentialInStream *stream, Byte ReservedSize, UInt32 &packSize, UInt32 &unpackSize) throw(); GetPackSize()21 UInt32 GetPackSize() const { return _size; } 22 // 32 bytes of overread zone is available after PackSize: GetData()23 const Byte *GetData() const { return _buf; } 24 }; 25 26 }} 27 28 #endif 29