| 230 | Status Open(int fd) { return OpenReadable(fd); } |
| 231 | |
| 232 | Result<std::shared_ptr<Buffer>> ReadBuffer(int64_t nbytes) { |
| 233 | ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateResizableBuffer(nbytes, pool_)); |
| 234 | |
| 235 | ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, Read(nbytes, buffer->mutable_data())); |
| 236 | if (bytes_read < nbytes) { |
| 237 | RETURN_NOT_OK(buffer->Resize(bytes_read)); |
| 238 | buffer->ZeroPadding(); |
| 239 | } |
| 240 | return buffer; |
| 241 | } |
| 242 | |
| 243 | Result<std::shared_ptr<Buffer>> ReadBufferAt(int64_t position, int64_t nbytes, |
| 244 | bool allow_short_read) { |