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

Method Read

cpp/src/arrow/io/transform.cc:75–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73bool TransformInputStream::closed() const { return impl_->closed_; }
74
75Result<std::shared_ptr<Buffer>> TransformInputStream::Read(int64_t nbytes) {
76 RETURN_NOT_OK(impl_->CheckClosed());
77
78 ARROW_ASSIGN_OR_RAISE(auto buf, AllocateResizableBuffer(nbytes));
79 ARROW_ASSIGN_OR_RAISE(auto bytes_read, this->Read(nbytes, buf->mutable_data()));
80 if (bytes_read < nbytes) {
81 RETURN_NOT_OK(buf->Resize(bytes_read, /*shrink_to_fit=*/true));
82 }
83 return std::shared_ptr<Buffer>(std::move(buf));
84}
85
86Result<int64_t> TransformInputStream::Read(int64_t nbytes, void* out) {
87 RETURN_NOT_OK(impl_->CheckClosed());

Callers

nothing calls this directly

Calls 10

SliceBufferFunction · 0.85
push_backMethod · 0.80
backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
CheckClosedMethod · 0.45
ResizeMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected