MCPcopy Create free account
hub / github.com/apache/arrow / ReadBufferAt

Method ReadBufferAt

cpp/src/arrow/io/file.cc:243–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 }
242
243 Result<std::shared_ptr<Buffer>> ReadBufferAt(int64_t position, int64_t nbytes,
244 bool allow_short_read) {
245 ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateResizableBuffer(nbytes, pool_));
246
247 ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, ReadAt(position, nbytes, allow_short_read,
248 buffer->mutable_data()));
249 if (bytes_read < nbytes) {
250 RETURN_NOT_OK(buffer->Resize(bytes_read));
251 buffer->ZeroPadding();
252 }
253 return buffer;
254 }
255
256 Status WillNeed(const std::vector<ReadRange>& ranges) {
257 auto report_error = [](int errnum, const char* msg) -> Status {

Callers 1

DoReadAtMethod · 0.80

Calls 1

ResizeMethod · 0.45

Tested by

no test coverage detected