| 235 | } |
| 236 | |
| 237 | Result<std::shared_ptr<Buffer>> ReadBufferAt(int64_t position, int64_t nbytes) { |
| 238 | ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateResizableBuffer(nbytes, pool_)); |
| 239 | |
| 240 | ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, |
| 241 | ReadAt(position, nbytes, buffer->mutable_data())); |
| 242 | if (bytes_read < nbytes) { |
| 243 | RETURN_NOT_OK(buffer->Resize(bytes_read)); |
| 244 | buffer->ZeroPadding(); |
| 245 | } |
| 246 | // R build with openSUSE155 requires an explicit shared_ptr construction |
| 247 | return std::shared_ptr<Buffer>(std::move(buffer)); |
| 248 | } |
| 249 | |
| 250 | Status WillNeed(const std::vector<ReadRange>& ranges) { |
| 251 | auto report_error = [](int errnum, const char* msg) -> Status { |