This is available as File\TemporaryFile in the www repository.
File\TemporaryFile
namespace HH\Lib\File; final class TemporaryFile implements \IDisposable {...}
->__construct(CloseableReadWriteHandle $handle)
->__dispose(): void
->getHandle(): CloseableReadWriteHandle