implemented Format::write functions