MCPcopy Create free account
hub / github.com/apache/datafusion / refill_input_if_needed

Method refill_input_if_needed

datafusion/datasource-json/src/utils.rs:288–299  ·  view source on GitHub ↗

Refill input buffer from inner reader if needed. Returns true if there's data available, false on EOF.

(&mut self)

Source from the content-addressed store, hash-verified

286 /// Refill input buffer from inner reader if needed.
287 /// Returns true if there's data available, false on EOF.
288 fn refill_input_if_needed(&mut self) -> std::io::Result<bool> {
289 if self.input_pos >= self.input_filled {
290 // Input buffer exhausted, read more from inner
291 let bytes_read = self.inner.read(&mut self.input_buffer)?;
292 if bytes_read == 0 {
293 return Ok(false); // EOF
294 }
295 self.input_pos = 0;
296 self.input_filled = bytes_read;
297 }
298 Ok(true)
299 }
300
301 /// Fill the output buffer with transformed data.
302 ///

Callers 1

fill_output_bufferMethod · 0.80

Calls 1

readMethod · 0.80

Tested by

no test coverage detected