/** * This method initializes a new buffered input stream that will read from * the specified subordinate stream with a buffer size that is specified by * the caller. */ public function __construct(InputStreamInterface $in, $readBufferSize = 1024) { parent::__construct($in, $readBufferSize); $this->offset = 0; $this->count = 0; $this->mark = -1; $this->markLimit = 0; }
/** * Create a filter input stream instance with the specified subordinate * input stream. * * @param InputStreamInterface $in The subordinate input stream. * @param int $bufferSize The maximum number of bytes that the internal * buffer can store. * @param int $readBufferSize The maximum number of bytes to be pre-fetched. * * @throws \InvalidArgumentException When the buffer size is less than 1. */ public function __construct(InputStreamInterface $in, $bufferSize = 1, $readBufferSize = 1024) { if ($bufferSize <= 0) { throw new \InvalidArgumentException(sprintf("The buffer size must be greater than %d.", 0)); } parent::__construct($in, $readBufferSize); $this->bufferSize = $bufferSize; }
/** * {@inheritdoc} */ public function __construct(InputStreamInterface $in, $readBufferSize = 1024) { parent::__construct($in, $readBufferSize); }