public function toStream(bool
$throw = true
) { if ($throw) { // Ensure headers arrived
$this->
getHeaders($throw);
} $stream = StreamWrapper::
createResource($this);
stream_get_meta_data($stream)['wrapper_data'
] ->
bindHandles($this->handle,
$this->content
);
return $stream;
} public function __sleep(): array
{ throw new \
BadMethodCallException('Cannot serialize '.__CLASS__
);
} /**
* @return void
*/