MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / Read

Method Read

Sources/Shared/IO/MemoryStream.cpp:95–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 std::int64_t MemoryStream::Read(void* destination, std::int64_t bytesToRead)
96 {
97 std::int64_t bytesRead = 0;
98 if (bytesToRead > 0 && _mode != AccessMode::None) {
99 DEATH_ASSERT(destination != nullptr, "destination is null", 0);
100
101 bytesRead = (_size < _pos + bytesToRead ? (_size - _pos) : bytesToRead);
102 if (bytesRead > 0) {
103 std::memcpy(destination, &_data[_pos], bytesRead);
104 _pos += bytesRead;
105 }
106 }
107 return bytesRead;
108 }
109
110 std::int64_t MemoryStream::Write(const void* source, std::int64_t bytesToWrite)
111 {

Callers 1

FetchFromStreamMethod · 0.45

Calls 1

DEATH_ASSERTFunction · 0.85

Tested by

no test coverage detected