| 38 | } |
| 39 | |
| 40 | const void* MemoryStream::GetData() const |
| 41 | { |
| 42 | if (!mChunks.empty()) |
| 43 | { |
| 44 | const size_t desiredSize = GetSize(); |
| 45 | |
| 46 | mLinearData.reserve(desiredSize); |
| 47 | |
| 48 | for (const Chunk& chunk : mChunks) |
| 49 | { |
| 50 | auto begin = chunk.Data.begin(); |
| 51 | auto end = begin + chunk.BytesUsed; |
| 52 | |
| 53 | mLinearData.insert(mLinearData.end(), begin, end); |
| 54 | } |
| 55 | |
| 56 | mChunks = {}; |
| 57 | } |
| 58 | |
| 59 | return mLinearData.data(); |
| 60 | } |
| 61 | |
| 62 | const size_t MemoryStream::GetSize() const noexcept |
| 63 | { |
no test coverage detected