9 #ifndef _CRYPTO_STREAMS_LIB_CACHEDBLOCK_H_
10 #define _CRYPTO_STREAMS_LIB_CACHEDBLOCK_H_
17 class SimpleProtectedStream;
22 CachedBlock(std::shared_ptr<SimpleProtectedStream>pSimple,
23 uint64_t u64BlockSize);
25 uint64_t GetBlockSize();
27 void UpdateBlock(uint64_t u64Position);
29 uint64_t ReadFromBlock(uint8_t *pbBuffer,
33 uint64_t WriteToBlock(
const uint8_t *pbBuffer,
37 void RewriteFinalBlock(uint64_t newSize);
39 uint64_t GetSizeInternal()
const;
40 void SizeInternal(uint64_t u64Size);
44 uint32_t CalculateBlockNumber(uint64_t u64Position)
const;
48 std::shared_ptr<SimpleProtectedStream> m_pSimple;
49 uint64_t m_u64BlockSize;
51 uint64_t m_u64CacheStart;
52 uint64_t m_u64CacheSize;
53 std::vector<uint8_t> m_cache;
54 bool m_bFinalBlockHasBeenWritten;
59 #endif // ifndef _CRYPTO_STREAMS_LIB_CACHEDBLOCK_H_
Definition: BlockBasedProtectedStream.cpp:13
Definition: CachedBlock.h:19