Write the record batch to an in-memory buffer in IPC Stream format
(rb: &RecordBatch)
| 2469 | |
| 2470 | /// Write the record batch to an in-memory buffer in IPC Stream format |
| 2471 | fn write_stream(rb: &RecordBatch) -> Vec<u8> { |
| 2472 | let mut buf = Vec::new(); |
| 2473 | let mut writer = crate::writer::StreamWriter::try_new(&mut buf, rb.schema_ref()).unwrap(); |
| 2474 | writer.write(rb).unwrap(); |
| 2475 | writer.finish().unwrap(); |
| 2476 | buf |
| 2477 | } |
| 2478 | |
| 2479 | /// Return the first record batch read from the IPC Stream buffer |
| 2480 | fn read_stream(buf: &[u8]) -> Result<RecordBatch, ArrowError> { |