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

Method ReadAt

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

Source from the content-addressed store, hash-verified

134 }
135
136 Result<int64_t> ReadAt(int64_t position, int64_t nbytes, bool allow_short_read,
137 void* out) {
138 RETURN_NOT_OK(CheckClosed());
139 RETURN_NOT_OK(internal::ValidateRange(position, nbytes));
140 // ReadAt() leaves the file position undefined, so require that we seek
141 // before calling Read() or Write().
142 need_seeking_.store(true);
143 ARROW_ASSIGN_OR_RAISE(auto real_nbytes, ::arrow::internal::FileReadAt(
144 fd_.fd(), reinterpret_cast<uint8_t*>(out),
145 position, nbytes));
146 if (!allow_short_read && real_nbytes != nbytes) {
147 return Status::IOError("File too short: expected to be able to read ", nbytes,
148 " bytes, got ", real_nbytes);
149 }
150 return real_nbytes;
151 }
152
153 Status Seek(int64_t pos) {
154 RETURN_NOT_OK(CheckClosed());

Callers

nothing calls this directly

Calls 4

ValidateRangeFunction · 0.85
IOErrorFunction · 0.85
storeMethod · 0.80
CheckClosedFunction · 0.70

Tested by

no test coverage detected