| 329 | } |
| 330 | |
| 331 | Result<int64_t> BufferReader::DoReadAt(int64_t position, int64_t nbytes, |
| 332 | bool allow_short_read, void* buffer) { |
| 333 | RETURN_NOT_OK(CheckClosed()); |
| 334 | |
| 335 | ARROW_ASSIGN_OR_RAISE(auto real_nbytes, |
| 336 | internal::ValidateReadRange(position, nbytes, size_)); |
| 337 | DCHECK_GE(nbytes, 0); |
| 338 | if (!allow_short_read && real_nbytes != nbytes) { |
| 339 | return Status::IOError("File too short: expected to be able to read ", nbytes, |
| 340 | " bytes, got ", real_nbytes); |
| 341 | } |
| 342 | if (real_nbytes) { |
| 343 | memcpy(buffer, data_ + position, real_nbytes); |
| 344 | } |
| 345 | return real_nbytes; |
| 346 | } |
| 347 | |
| 348 | Result<std::shared_ptr<Buffer>> BufferReader::DoReadAt(int64_t position, int64_t nbytes, |
| 349 | bool allow_short_read) { |
nothing calls this directly
no test coverage detected