Read one byte. See "include/loader/filemgr.h".
| 63 | |
| 64 | // Read one byte. See "include/loader/filemgr.h". |
| 65 | Expect<Byte> FileMgr::readByte() { |
| 66 | if (unlikely(Status != ErrCode::Value::Success)) { |
| 67 | return Unexpect(Status); |
| 68 | } |
| 69 | // Set the flag to the start offset. |
| 70 | LastPos = Pos; |
| 71 | // Check whether reading exceeds the data or section boundary. |
| 72 | EXPECTED_TRY(testRead(1)); |
| 73 | return Data[Pos++]; |
| 74 | } |
| 75 | |
| 76 | // Read bytes. See "include/loader/filemgr.h". |
| 77 | Expect<std::vector<Byte>> FileMgr::readBytes(size_t SizeToRead) { |