The containing class is available as File\WriteHandle in the www repository.
File\WriteHandle
public function truncate( ?int $length = NULL, ): void;
?int $length = NULL
void