Reads from multiple streams, one after the other.

This is a read-only stream decorator.

  • Implements
public __construct(array $streams = [])
  • param \StreamInterface[] $streams Streams to decorate. Each stream must be readable.
public __toString() : string
public addStream(Psr\Http\Message\StreamInterface $stream) : void

Add a stream to the AppendStream

  • param \StreamInterface $stream Stream to append. Must be readable.
  • throws \InvalidArgumentException if the stream is not readable
public close() : void

Closes each attached stream.

public detach()

Detaches each attached stream.

Returns null as it's not clear which underlying stream resource to return.

public eof() : bool
public getContents() : string
public getMetadata( $key = NULL)
  • return mixed
public getSize() : ?int

Tries to calculate the size by adding the size of each stream.

If any of the streams do not return a valid number, then the size of the append stream cannot be determined and null is returned.

public isReadable() : bool
public isSeekable() : bool
public isWritable() : bool
public read( $length) : string

Reads from all of the appended streams until the length is met or EOF.

public rewind() : void
public seek( $offset, $whence = 0GuzzleHttp\Psr7\SEEK_SET) : void

Attempts to seek to the given position. Only supports SEEK_SET.

public tell() : int
public write( $string) : int
private $current = 0
  • var int
private $pos = 0
  • var int
private $seekable = true
  • var bool
private $streams = []
  • var \StreamInterface[] Streams being decorated
© 2024 Bruce Wells
Search Namespaces \ Classes