public function flush() { $this->stream->flush(); }
/** * Perform the copy between this stream and the destination. * @param StreamInterface $destination * @param int|null $bufferSize */ protected function internalCopyTo(StreamInterface $destination, $bufferSize = null) { if (null !== $bufferSize && $bufferSize <= 0) { throw new Exception\InvalidArgumentException('bufferSize', $bufferSize, 'Parameter "bufferSize" must be greater than 0.'); } // Use native implementation if possible. if ($destination instanceof self) { // Ensure pending data is dealt with, as we are bypassing write() $destination->flush(); stream_copy_to_stream($this->handle, $destination->handle); return; } // Copy in chunks $bufferSize = $bufferSize ?: $this->defaultCopyBufferSize; while (($data = $this->read($bufferSize)) !== null) { $destination->write($data); } }
public function flush() { $this->initializeStream(); $this->stream->flush(); }