- /// @result - The number of bytes copied if successful; (uint64_t)-1
- /// if not.
- /// Failure may be due to a bounds violation or an
- /// implementation-specific error.
- virtual uint64_t readBytes(uint64_t address,
- uint64_t size,
- uint8_t* buf) const {
- uint64_t current = address;
- uint64_t limit = getBase() + getExtent();
- uint64_t ret = 0;
-
- while(current - address < size && current < limit) {
- if(readByte(current, &buf[(current - address)]))
- return (uint64_t)-1;
-
- ret++;
- }
-
- return ret;
- }
+ /// @result - 0 if successful; -1 if not. Failure may be due to a
+ /// bounds violation or an implementation-specific error.
+ virtual int readBytes(uint64_t address, uint64_t size, uint8_t *buf) const;