pub fn try_new(reader: R) -> Result<Self> {
        let mut reader = BufReader::new(reader);
        // determine metadata length
        let mut meta_size: [u8; 4] = [0; 4];
        reader.read_exact(&mut meta_size)?;
        let meta_len = {
            // If a continuation marker is encountered, skip over it and read
            // the size from the next four bytes.
            if meta_size == CONTINUATION_MARKER {
                reader.read_exact(&mut meta_size)?;
            }
            i32::from_le_bytes(meta_size)
        };

        let mut meta_buffer = vec![0; meta_len as usize];
        reader.read_exact(&mut meta_buffer)?;

        let message = gen::Message::root_as_message(meta_buffer.as_slice())
            .map_err(|err| ArrowError::IPC(format!("Unable to get root as message: {:?}", err)))?;
        // message header is a Schema, so read it
        let ipc_schema: gen::Schema::Schema = message
            .header_as_schema()
            .ok_or_else(|| ArrowError::IPC("Unable to read IPC message as schema".to_string()))?;
        let schema = convert::fb_to_schema(ipc_schema);

        // Create an array of optional dictionary value arrays, one per field.
        // todo: this is wrong for nested types, as there must be one dictionary per node, not per field
        let dictionaries_by_field = vec![None; schema.fields().len()];

        Ok(Self {
            reader,
            schema,
            finished: false,
            dictionaries_by_field,
        })
    }
/// Try to create a new stream reader
///
/// The first message in the stream is the schema, the reader will fail if it does not
/// encounter a schema.
/// To check if the reader is done, use `is_finished(self)`
Try to create a new stream reader
The first message in the stream is the schema, the reader will fail if it does not
encounter a schema.
To check if the reader is done, use `is_finished(self)`
Try to create a new stream reader The first message in the stream is the schema the reader will fail if it does not encounter a schema . To check if the reader is done use ` is_finished ( self ) `
pub fn try_new(reader: R) -> Result<Self> {
        let mut reader = BufReader::new(reader);
        // determine metadata length
        let mut meta_size: [u8; 4] = [0; 4];
        reader.read_exact(&mut meta_size)?;
        let meta_len = {
            // If a continuation marker is encountered, skip over it and read
            // the size from the next four bytes.
            if meta_size == CONTINUATION_MARKER {
                reader.read_exact(&mut meta_size)?;
            }
            i32::from_le_bytes(meta_size)
        };
        let mut meta_buffer = vec![0; meta_len as usize];
        reader.read_exact(&mut meta_buffer)?;
        let message = gen::Message::root_as_message(meta_buffer.as_slice())
            .map_err(|err| ArrowError::IPC(format!("Unable to get root as message: {:?}", err)))?;
        // message header is a Schema, so read it
        let ipc_schema: gen::Schema::Schema = message
            .header_as_schema()
            .ok_or_else(|| ArrowError::IPC("Unable to read IPC message as schema".to_string()))?;
        let schema = convert::fb_to_schema(ipc_schema);
        // Create an array of optional dictionary value arrays, one per field.
        // todo: this is wrong for nested types, as there must be one dictionary per node, not per field
        let dictionaries_by_field = vec![None; schema.fields().len()];
        Ok(Self {
            reader,
            schema,
            finished: false,
            dictionaries_by_field,
        })
    }
pub fn try_new ( reader : R ) -> Result < Self > { let mut reader = BufReader :: new ( reader ) ; // determine metadata length let mut meta_size : [ u8 ; 4 ] = [ 0 ; 4 ] ; reader . read_exact ( & mut meta_size ) ? ; let meta_len = { // If a continuation marker is encountered, skip over it and read // the size from the next four bytes. if meta_size == CONTINUATION_MARKER { reader . read_exact ( & mut meta_size ) ? ; } i32 :: from_le_bytes ( meta_size ) } ; let mut meta_buffer = vec ! [ 0 meta_len as usize ] ; reader . read_exact ( & mut meta_buffer ) ? ; let message = gen :: Message :: root_as_message ( meta_buffer . as_slice ( ) ) . map_err ( | err | ArrowError :: IPC ( format ! ( " " err ) ) ) ? ; // message header is a Schema, so read it let ipc_schema : gen :: Schema :: Schema = message . header_as_schema ( ) . ok_or_else ( | | ArrowError :: IPC ( " " . to_string ( ) ) ) ? ; let schema = convert :: fb_to_schema ( ipc_schema ) ; // Create an array of optional dictionary value arrays, one per field. // todo: this is wrong for nested types, as there must be one dictionary per node, not per field let dictionaries_by_field = vec ! [ None schema fields ( ) len ( ) ] ; Ok ( Self { reader , schema , finished : false , dictionaries_by_field , } ) }
Try to create a new stream reader
The first message in the stream is the schema, the reader will fail if it does not
encounter a schema.
Try to create a new stream reader The first message in the stream is the schema the reader will fail if it does not encounter a schema .
reader
R
reader
R