fn encode_sink_buffer(
buffer: Buffer,
ipc_meta_data: &mut IpcMetadataBuilder,
sink: &mut IpcBodySink<'_>,
offset: i64,
compression_codec: Option<CompressionCodec>,
compression_context: &mut CompressionContext,
alignment: u8,
) -> Result<i64, ArrowError>Expand description
Encodes a single Arrow [Buffer] into the IPC body and records its metadata.
buffer: the Arrow data buffer to encode (validity bitmap, offsets, values, etc.)buffers: in-progress list of IPCBuffermetadata entries (body offset + length) that will eventually be serialised into the flatbufferRecordBatchheader.sink: destination for the actual encoded bytes; either a contiguousVec<u8>for in-memory writes, or a list ofEncodedBuffersegments for deferred zero-copy streaming.offset: running byte offset into the IPC message body, used to compute the metadata entry.compression_codec/compression_context: ifSome, the buffer is compressed before writing;compression_contextprovides reusable scratch space across calls.alignment: each buffer is padded to this many bytes so the next buffer starts aligned.
Returns the updated offset (advanced by the encoded length plus any alignment padding).