Get slice of Data[Offset : Offset + Length - 1]
| 143 | |
| 144 | /// Get slice of Data[Offset : Offset + Length - 1] |
| 145 | Expect<Span<Byte>> getBytes(const uint64_t Offset, |
| 146 | const uint64_t Length) const noexcept { |
| 147 | // Check the memory boundary. |
| 148 | if (unlikely(!checkAccessBound(Offset, Length))) { |
| 149 | spdlog::error(ErrCode::Value::MemoryOutOfBounds); |
| 150 | spdlog::error(ErrInfo::InfoBoundary(Offset, Length, getSize())); |
| 151 | return Unexpect(ErrCode::Value::MemoryOutOfBounds); |
| 152 | } |
| 153 | return Span<Byte>(&DataPtr[Offset], Length); |
| 154 | } |
| 155 | |
| 156 | /// Replace the bytes of Data[Offset :] by Slice[Start : Start + Length - 1] |
| 157 | Expect<void> setBytes(Span<const Byte> Slice, const uint64_t Offset, |
no test coverage detected