add truncate method in interface io::write_map