/** * Constructs an instance of this class. * * @param IoStream $stream * @param string $mode desired access mode */ public function __construct(IoStream $stream, string $mode) { $stream->open(new AccessMode($mode)); $this->stream = $stream; }