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

Method DoBuffer

cpp/src/arrow/io/buffered.cc:374–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372 }
373
374 Status DoBuffer() {
375 // Fill the buffer from the raw stream with at most `buffer_size_` bytes.
376 if (!buffer_) {
377 RETURN_NOT_OK(ResetBuffer());
378 }
379
380 int64_t bytes_to_buffer = buffer_size_;
381 if (raw_read_bound_ >= 0) {
382 bytes_to_buffer = std::min(buffer_size_, raw_read_bound_ - raw_read_total_);
383 }
384 ARROW_ASSIGN_OR_RAISE(bytes_buffered_, raw_->Read(bytes_to_buffer, buffer_data_));
385 buffer_pos_ = 0;
386 raw_read_total_ += bytes_buffered_;
387
388 // Do not make assumptions about the raw stream position
389 raw_pos_ = -1;
390 return Status::OK();
391 }
392
393 Status BufferIfNeeded() {
394 if (bytes_buffered_ == 0) {

Callers

nothing calls this directly

Calls 3

ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
ReadMethod · 0.45

Tested by

no test coverage detected