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

Method ReadBufferAt

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

Source from the content-addressed store, hash-verified

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 {

Callers 1

DoReadAtMethod · 0.80

Calls 1

ResizeMethod · 0.45

Tested by

no test coverage detected