9 #ifndef _RMS_CRYPTO_ISTREAM_H_
10 #define _RMS_CRYPTO_ISTREAM_H_
16 #include "CryptoAPIExport.h"
21 typedef std::shared_ptr<IStream> SharedStream;
39 virtual std::shared_future<int64_t> ReadAsync(uint8_t *pbBuffer,
42 std::launch launchType)
44 virtual std::shared_future<int64_t> WriteAsync(
const uint8_t *cpbBuffer,
47 std::launch launchType)
49 virtual std::future<bool> FlushAsync(std::launch launchType) = 0;
52 virtual int64_t Read(uint8_t *pbBuffer,
53 int64_t cbBuffer) = 0;
54 virtual int64_t Write(
const uint8_t *cpbBuffer,
55 int64_t cbBuffer) = 0;
56 virtual bool Flush() = 0;
58 virtual SharedStream Clone() = 0;
60 virtual void Seek(uint64_t u64Position) = 0;
61 virtual bool CanRead()
const = 0;
62 virtual bool CanWrite()
const = 0;
63 virtual uint64_t Position() = 0;
64 virtual uint64_t Size() = 0;
65 virtual void Size(uint64_t u64Value) = 0;
67 virtual std::vector<uint8_t> Read(uint64_t u64size)
69 std::vector<uint8_t> plainText;
73 plainText.resize(u64size);
75 static_cast<int>(Read(&plainText[0], static_cast<int>(plainText.size())));
76 plainText.resize(actualSize);
87 #endif // _RMS_CRYPTO_ISTREAM_H_
Definition: BlockBasedProtectedStream.cpp:13
Base interface for protected streams.
Definition: IStream.h:34