| 134 | } |
| 135 | |
| 136 | Result<int64_t> ReadAt(int64_t position, int64_t nbytes, bool allow_short_read, |
| 137 | void* out) { |
| 138 | RETURN_NOT_OK(CheckClosed()); |
| 139 | RETURN_NOT_OK(internal::ValidateRange(position, nbytes)); |
| 140 | // ReadAt() leaves the file position undefined, so require that we seek |
| 141 | // before calling Read() or Write(). |
| 142 | need_seeking_.store(true); |
| 143 | ARROW_ASSIGN_OR_RAISE(auto real_nbytes, ::arrow::internal::FileReadAt( |
| 144 | fd_.fd(), reinterpret_cast<uint8_t*>(out), |
| 145 | position, nbytes)); |
| 146 | if (!allow_short_read && real_nbytes != nbytes) { |
| 147 | return Status::IOError("File too short: expected to be able to read ", nbytes, |
| 148 | " bytes, got ", real_nbytes); |
| 149 | } |
| 150 | return real_nbytes; |
| 151 | } |
| 152 | |
| 153 | Status Seek(int64_t pos) { |
| 154 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no test coverage detected