pub fn write<W: Write>(&self, writer: W) -> io::Result<()> {
        // Before writing anything, wrap the writer so we can calculate CRC32
        // on the fly.
        let mut writer = Crc32Writer::new(writer);

        // Serialize all normal tags (excluding the end tag)
        self.to_tags(|tag| tag.write(&mut writer))?;

        // Writing the final checksum is a bit annoying since its tag ID and
        // length are part of the checksum.
        writer.write_u32::<LittleEndian>(TagId::End as u32)?;
        writer.write_u32::<LittleEndian>(4)?; // 4 byte CRC32 checksum
        let crc = writer.digest.finalize();
        writer.inner.write_u32::<LittleEndian>(crc)?;

        Ok(())
    }
/// Serializes the binary representation of this GBL into a writer.
Serializes the binary representation of this GBL into a writer.
Serializes the binary representation of this GBL into a writer .
pub fn write<W: Write>(&self, writer: W) -> io::Result<()> {
        // Before writing anything, wrap the writer so we can calculate CRC32
        // on the fly.
        let mut writer = Crc32Writer::new(writer);
        // Serialize all normal tags (excluding the end tag)
        self.to_tags(|tag| tag.write(&mut writer))?;
        // Writing the final checksum is a bit annoying since its tag ID and
        // length are part of the checksum.
        writer.write_u32::<LittleEndian>(TagId::End as u32)?;
        writer.write_u32::<LittleEndian>(4)?; // 4 byte CRC32 checksum
        let crc = writer.digest.finalize();
        writer.inner.write_u32::<LittleEndian>(crc)?;
        Ok(())
    }
pub fn write < W : Write > ( & self , writer : W ) -> io :: Result < ( ) > { // Before writing anything, wrap the writer so we can calculate CRC32 // on the fly. let mut writer = Crc32Writer :: new ( writer ) ; // Serialize all normal tags (excluding the end tag) self . to_tags ( | tag | tag . write ( & mut writer ) ) ? ; // Writing the final checksum is a bit annoying since its tag ID and // length are part of the checksum. writer . write_u32 :: < LittleEndian > ( TagId :: End as u32 ) ? ; writer . write_u32 :: < LittleEndian > ( 4 ) ? ; // 4 byte CRC32 checksum let crc = writer . digest . finalize ( ) ; writer . inner . write_u32 :: < LittleEndian > ( crc ) ? ; Ok ( ( ) ) }
Serializes the binary representation of this GBL into a writer.
Serializes the binary representation of this GBL into a writer .
&self
writer
W