public function __construct(ReadableStream $stream, bool $cascadeClose = true, WritableStream $expectContinue = null) { parent::__construct($stream); $this->cascadeClose = $cascadeClose; $this->expectContinue = $expectContinue; $this->defer = new Deferred(); }
/** * Create a new buffered stream as needed by a buffered HTTP body. * * @param FilesystemTempStream $temp Temp file stream being used as secondary buffer. * @param ReadableStream $source Source stream that needs buffering. * @param int $bufferSize In-memory buffer size (will be used as read size). * @param BufferedBody $body Buffered HTTP body being used. */ public function __construct(FilesystemTempStream $temp, ReadableStream $source, int $bufferSize, BufferedBody $body) { parent::__construct($temp); $this->source = $source; $this->bufferSize = $bufferSize; $this->body = $body; $this->cascadeClose = false; }
public function __construct(ReadableStream $stream, int $encoding = null, int $level = 1, array $options = []) { if (!isset($options['window'])) { $options['window'] = 15; } $this->context = \deflate_init($encoding ?? \ZLIB_ENCODING_GZIP, \array_merge($options, ['level' => $level])); $this->bufferSize = \max(8192, \pow(2, $options['window'])); parent::__construct($stream); }
/** * Create a length-limited input stream. * * @param ReadableStream $stream Wrapped input stream. * @param int $limit Maximum number of bytes to be read from the stream. * @param bool $cascadeClose Cascade call to close to wrapped stream? */ public function __construct(ReadableStream $stream, int $limit, bool $cascadeClose = true) { if ($limit < 0) { throw new \InvalidArgumentException('Limit must not be negative'); } parent::__construct($stream); $this->limit = $limit; $this->cascadeClose = $cascadeClose; }
public function __construct(ReadableStream $stream, int $encoding = null) { parent::__construct($stream); $this->context = \inflate_init($encoding ?? \ZLIB_ENCODING_GZIP); }
/** * Create a stream that will decode HTTP chunk-encoded data. * * @param ReadableStream $stream Stream that provides chunk-encoded data. * @param bool $cascadeClose Cascade the close operation to the wrapped stream? */ public function __construct(ReadableStream $stream, bool $cascadeClose = true) { parent::__construct($stream); $this->cascadeClose = $cascadeClose; }