| 150 | RandomAccessFile::RandomAccessFile() : interface_impl_(new Impl()) {} |
| 151 | |
| 152 | Result<int64_t> RandomAccessFile::ReadAt(int64_t position, int64_t nbytes, |
| 153 | bool allow_short_read, void* out) { |
| 154 | ARROW_ASSIGN_OR_RAISE(auto real_nbytes, ReadAt(position, nbytes, out)); |
| 155 | if (!allow_short_read && real_nbytes != nbytes) { |
| 156 | return Status::IOError("File too short: expected to be able to read ", nbytes, |
| 157 | " bytes, got ", real_nbytes); |
| 158 | } |
| 159 | return real_nbytes; |
| 160 | } |
| 161 | |
| 162 | Result<int64_t> RandomAccessFile::ReadAt(int64_t position, int64_t nbytes, void* out) { |
| 163 | std::lock_guard<std::mutex> lock(interface_impl_->lock_); |