pub fn end_extra_data(&mut self) -> ZipResult<u64> {
        // Require `start_file_with_extra_data()`. Ensures `file` is some.
        if !self.writing_to_extra_field {
            return Err(ZipError::Io(io::Error::new(
                io::ErrorKind::Other,
                "Not writing to extra field",
            )));
        }
        let file = self.files.last_mut().unwrap();

        validate_extra_data(&file)?;

        if !self.writing_to_central_extra_field_only {
            let writer = self.inner.get_plain();

            // Append extra data to local file header and keep it for central file header.
            writer.write_all(&file.extra_field)?;

            // Update final `data_start`.
            let header_end = file.data_start + file.extra_field.len() as u64;
            self.stats.start = header_end;
            file.data_start = header_end;

            // Update extra field length in local file header.
            let extra_field_length =
                if file.large_file { 20 } else { 0 } + file.extra_field.len() as u16;
            writer.seek(io::SeekFrom::Start(file.header_start + 28))?;
            writer.write_u16::<LittleEndian>(extra_field_length)?;
            writer.seek(io::SeekFrom::Start(header_end))?;

            self.inner.switch_to(file.compression_method)?;
        }

        self.writing_to_extra_field = false;
        self.writing_to_central_extra_field_only = false;
        Ok(file.data_start)
    }
/// End extra data and start file data. Requires [`ZipWriter::start_file_with_extra_data`].
///
/// Returns the final starting offset of the file data.
End extra data and start file data.
End extra data and start file data .
pub fn end_extra_data(&mut self) -> ZipResult<u64> {
        // Require `start_file_with_extra_data()`. Ensures `file` is some.
        if !self.writing_to_extra_field {
            return Err(ZipError::Io(io::Error::new(
                io::ErrorKind::Other,
                "Not writing to extra field",
            )));
        }
        let file = self.files.last_mut().unwrap();
        validate_extra_data(&file)?;
        if !self.writing_to_central_extra_field_only {
            let writer = self.inner.get_plain();
            // Append extra data to local file header and keep it for central file header.
            writer.write_all(&file.extra_field)?;
            // Update final `data_start`.
            let header_end = file.data_start + file.extra_field.len() as u64;
            self.stats.start = header_end;
            file.data_start = header_end;
            // Update extra field length in local file header.
            let extra_field_length =
                if file.large_file { 20 } else { 0 } + file.extra_field.len() as u16;
            writer.seek(io::SeekFrom::Start(file.header_start + 28))?;
            writer.write_u16::<LittleEndian>(extra_field_length)?;
            writer.seek(io::SeekFrom::Start(header_end))?;
            self.inner.switch_to(file.compression_method)?;
        }
        self.writing_to_extra_field = false;
        self.writing_to_central_extra_field_only = false;
        Ok(file.data_start)
    }
pub fn end_extra_data ( & mut self ) -> ZipResult < u64 > { // Require `start_file_with_extra_data()`. Ensures `file` is some. if ! self . writing_to_extra_field { return Err ( ZipError :: Io ( io :: Error :: new ( io :: ErrorKind :: Other , " " , ) ) ) ; } let file = self . files . last_mut ( ) . unwrap ( ) ; validate_extra_data ( & file ) ? ; if ! self . writing_to_central_extra_field_only { let writer = self . inner . get_plain ( ) ; // Append extra data to local file header and keep it for central file header. writer . write_all ( & file . extra_field ) ? ; // Update final `data_start`. let header_end = file . data_start + file . extra_field . len ( ) as u64 ; self . stats . start = header_end ; file . data_start = header_end ; // Update extra field length in local file header. let extra_field_length = if file . large_file { 20 } else { 0 } + file . extra_field . len ( ) as u16 ; writer . seek ( io :: SeekFrom :: Start ( file . header_start + 28 ) ) ? ; writer . write_u16 :: < LittleEndian > ( extra_field_length ) ? ; writer . seek ( io :: SeekFrom :: Start ( header_end ) ) ? ; self . inner . switch_to ( file . compression_method ) ? ; } self . writing_to_extra_field = false ; self . writing_to_central_extra_field_only = false ; Ok ( file . data_start ) }
End extra data and start file data.
End extra data and start file data .
&mut self
&mut self