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

Method DoReadAt

cpp/src/arrow/io/memory.cc:331–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331Result<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
348Result<std::shared_ptr<Buffer>> BufferReader::DoReadAt(int64_t position, int64_t nbytes,
349 bool allow_short_read) {

Callers

nothing calls this directly

Calls 3

IOErrorFunction · 0.85
SliceBufferFunction · 0.85
CheckClosedFunction · 0.70

Tested by

no test coverage detected