pub struct HeaderDecoder {
state: HeaderDecoderState,
vlq_decoder: VLQDecoder,
meta_offsets: Vec<usize>,
meta_buf: Vec<u8>,
sync_marker: [u8; 16],
tuples_remaining: usize,
bytes_remaining: usize,
}
Expand description
A decoder for Header
The avro file format does not encode the length of the header, and so it is necessary to provide a push-based decoder that can be used with streams
Fields§
§state: HeaderDecoderState
§vlq_decoder: VLQDecoder
§meta_offsets: Vec<usize>
The end offsets of strings in meta_buf
meta_buf: Vec<u8>
The raw binary data of the metadata map
sync_marker: [u8; 16]
The decoded sync marker
tuples_remaining: usize
The number of remaining tuples in the current block
bytes_remaining: usize
The number of bytes remaining in the current string/bytes payload
Implementations§
Source§impl HeaderDecoder
impl HeaderDecoder
Sourcepub fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>
pub fn decode(&mut self, buf: &[u8]) -> Result<usize, ArrowError>
Parse Header
from buf
, returning the number of bytes read
This method can be called multiple times with consecutive chunks of data, allowing
integration with chunked IO systems like BufRead::fill_buf
All errors should be considered fatal, and decoding aborted
Once the entire Header
has been decoded this method will not read any further
input bytes, and the header can be obtained with Self::flush