pub fn flush(&mut self) -> Result<usize, Error> {
        if self.num_values == 0 {
            return Ok(0);
        }

        self.codec.compress(&mut self.buffer)?;

        let num_values = self.num_values;
        let stream_len = self.buffer.len();

        let num_bytes = self.append_raw(&num_values.avro(), &Schema::Long)?
            + self.append_raw(&stream_len.avro(), &Schema::Long)?
            + self.writer.write(self.buffer.as_ref())?
            + self.append_marker()?;

        self.buffer.clear();
        self.num_values = 0;

        Ok(num_bytes)
    }
/// Flush the content appended to a `Writer`. Call this function to make sure all the content
/// has been written before releasing the `Writer`.
///
/// Return the number of bytes written.
Flush the content appended to a `Writer`. Call this function to make sure all the content
has been written before releasing the `Writer`.

Return the number of bytes written.
Flush the content appended to a ` Writer ` . Call this function to make sure all the content has been written before releasing the ` Writer ` . Return the number of bytes written .
pub fn flush(&mut self) -> Result<usize, Error> {
        if self.num_values == 0 {
            return Ok(0);
        }
        self.codec.compress(&mut self.buffer)?;
        let num_values = self.num_values;
        let stream_len = self.buffer.len();
        let num_bytes = self.append_raw(&num_values.avro(), &Schema::Long)?
            + self.append_raw(&stream_len.avro(), &Schema::Long)?
            + self.writer.write(self.buffer.as_ref())?
            + self.append_marker()?;
        self.buffer.clear();
        self.num_values = 0;
        Ok(num_bytes)
    }
pub fn flush ( & mut self ) -> Result < usize , Error > { if self . num_values == 0 { return Ok ( 0 ) ; } self . codec . compress ( & mut self . buffer ) ? ; let num_values = self . num_values ; let stream_len = self . buffer . len ( ) ; let num_bytes = self . append_raw ( & num_values . avro ( ) , & Schema :: Long ) ? + self . append_raw ( & stream_len . avro ( ) , & Schema :: Long ) ? + self . writer . write ( self . buffer . as_ref ( ) ) ? + self . append_marker ( ) ? ; self . buffer . clear ( ) ; self . num_values = 0 ; Ok ( num_bytes ) }
Flush the content appended to a `Writer`.
Flush the content appended to a ` Writer ` .
&mut self