ParagonIE\Halite\Stream\MutableFile::__construct PHP Method

__construct() public method

MutableFile constructor.
public __construct ( $file )
$file
    public function __construct($file)
    {
        if (is_string($file)) {
            $this->fp = \fopen($file, 'wb');
            $this->closeAfter = true;
            $this->pos = 0;
            $this->stat = \fstat($this->fp);
        } elseif (is_resource($file)) {
            $this->fp = $file;
            $this->pos = \ftell($this->fp);
            $this->stat = \fstat($this->fp);
        } else {
            throw new CryptoException\InvalidType('Argument 1: Expected a filename or resource');
        }
    }