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

Method ReadBuffer

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

Source from the content-addressed store, hash-verified

230 Status Open(int fd) { return OpenReadable(fd); }
231
232 Result<std::shared_ptr<Buffer>> ReadBuffer(int64_t nbytes) {
233 ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateResizableBuffer(nbytes, pool_));
234
235 ARROW_ASSIGN_OR_RAISE(int64_t bytes_read, Read(nbytes, buffer->mutable_data()));
236 if (bytes_read < nbytes) {
237 RETURN_NOT_OK(buffer->Resize(bytes_read));
238 buffer->ZeroPadding();
239 }
240 return buffer;
241 }
242
243 Result<std::shared_ptr<Buffer>> ReadBufferAt(int64_t position, int64_t nbytes,
244 bool allow_short_read) {

Callers 1

DoReadMethod · 0.45

Calls 1

ResizeMethod · 0.45

Tested by

no test coverage detected