Reads the next [`RecordBatch`] returning `Ok(None)` if EOF
(&mut self)
| 372 | impl<R: BufRead> Reader<R> { |
| 373 | /// Reads the next [`RecordBatch`] returning `Ok(None)` if EOF |
| 374 | fn read(&mut self) -> Result<Option<RecordBatch>, ArrowError> { |
| 375 | loop { |
| 376 | let buf = self.reader.fill_buf()?; |
| 377 | if buf.is_empty() { |
| 378 | break; |
| 379 | } |
| 380 | let read = buf.len(); |
| 381 | |
| 382 | let decoded = self.decoder.decode(buf)?; |
| 383 | self.reader.consume(decoded); |
| 384 | if decoded != read { |
| 385 | break; |
| 386 | } |
| 387 | } |
| 388 | self.decoder.flush() |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | impl<R: BufRead> Iterator for Reader<R> { |