| 46 | } |
| 47 | |
| 48 | std::int64_t BoundedFileStream::Read(void* destination, std::int64_t bytesToRead) |
| 49 | { |
| 50 | if (bytesToRead <= 0) { |
| 51 | return 0; |
| 52 | } |
| 53 | |
| 54 | DEATH_ASSERT(destination != nullptr, "destination is null", 0); |
| 55 | |
| 56 | std::int64_t pos = _underlyingStream.GetPosition() - _offset; |
| 57 | if (bytesToRead > static_cast<std::int64_t>(_size) - pos) { |
| 58 | bytesToRead = static_cast<std::int64_t>(_size) - pos; |
| 59 | } |
| 60 | |
| 61 | return _underlyingStream.Read(destination, bytesToRead); |
| 62 | } |
| 63 | |
| 64 | std::int64_t BoundedFileStream::Write(const void* source, std::int64_t bytesToWrite) |
| 65 | { |
nothing calls this directly
no test coverage detected