/// Set the payload of an EXTENT block. The bytes written will be returned.
Set the payload of an EXTENT block. The bytes written will be returned.
Set the payload of an EXTENT block . The bytes written will be returned .
pub fn extent_set_contents(&self, value: &[u8]) -> Result<usize, Error> {
        self.check_type(BlockType::Extent)?;
        let max_bytes = utils::payload_size_for_order(self.order());
        let mut bytes = value;
        if bytes.len() > max_bytes {
            bytes = &bytes[..min(bytes.len(), max_bytes)];
        }
        self.write_payload_from_bytes(bytes);
        Ok(bytes.len())
    }
pub fn extent_set_contents ( & self , value : & [ u8 ] ) -> Result < usize , Error > { self . check_type ( BlockType :: Extent ) ? ; let max_bytes = utils :: payload_size_for_order ( self . order ( ) ) ; let mut bytes = value ; if bytes . len ( ) > max_bytes { bytes = & bytes [ .. min ( bytes . len ( ) , max_bytes ) ] ; } self . write_payload_from_bytes ( bytes ) ; Ok ( bytes . len ( ) ) }
Set the payload of an EXTENT block.
Set the payload of an EXTENT block .
&self
value
&[u8]