/** * Create a new file input stream instance. * * @param string $source The file path. * @param string $mode The accessing mode. */ public function __construct($source, $mode) { parent::__construct(); $this->source = $source; $this->mode = $mode; $this->resource = @fopen($source, $mode); $this->closed = false === $this->resource ? true : false; }
/** * Constructor. * * @param PipedOutputStreamInterface $upstream The piped output stream to * connect. */ public function __construct(PipedOutputStreamInterface $upstream = null) { parent::__construct(); $this->buffer = ''; $this->upstream = $upstream; $this->closed = false; if (null !== $upstream) { $this->connect($upstream, true); } }
/** * Constructor. * * @param string $buffer The underlying input buffer. */ public function __construct($buffer) { parent::__construct(); $this->buffer = $buffer; $this->offset = 0; }
/** * {@inheritdoc} */ public function close() { $this->in->close(); parent::close(); return $this; }