| 13 | PhobosByteStream::~PhobosByteStream() = default; |
| 14 | |
| 15 | bool PhobosByteStream::ReadFromStream(IStream* pStm, const size_t Length) |
| 16 | { |
| 17 | auto size = this->Data.size(); |
| 18 | this->Data.resize(size + Length); |
| 19 | auto pv = reinterpret_cast<void*>(this->Data.data()); |
| 20 | |
| 21 | ULONG out = 0; |
| 22 | auto success = pStm->Read(pv, Length, &out); |
| 23 | bool result(SUCCEEDED(success) && out == Length); |
| 24 | |
| 25 | if (!result) |
| 26 | this->Data.resize(size); |
| 27 | |
| 28 | return result; |
| 29 | } |
| 30 | |
| 31 | bool PhobosByteStream::WriteToStream(IStream* pStm) const |
| 32 | { |
no test coverage detected