MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / ReadFromStream

Method ReadFromStream

src/Utilities/Stream.cpp:15–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13PhobosByteStream::~PhobosByteStream() = default;
14
15bool 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
31bool PhobosByteStream::WriteToStream(IStream* pStm) const
32{

Callers 1

ReadBlockFromStreamMethod · 0.95

Calls 3

sizeMethod · 0.45
dataMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected