Decorator used to return only a subset of a stream

CloneableInstantiable
ImplementsPsr\Http\Message\StreamInterface
Methods
public __call( $method, array $args)
 

Allow decorators to implement custom methods

  • return mixed
public __construct(Psr\Http\Message\StreamInterface $stream, $limit = -1, $offset = 0)
 
    public __get( $name)
     

    Magic method used to create a new stream if streams are not added in
    the constructor of a decorator (e.g., LazyOpenStream).

    • return StreamInterface
    public __toString()
    public close()
    public detach()
    public eof()
    public getContents()
    public getMetadata( $key = NULL)
    public getSize()
     

    Returns the size of the limited subset of data
    {@inheritdoc}

    public isReadable()
    public isSeekable()
    public isWritable()
    public read( $length)
    public rewind()
    public seek( $offset, $whence = 0)
     

    Allow for a bounded seek on the read limited stream
    {@inheritdoc}

    public setLimit( $limit)
     

    Set the limit of bytes that the decorator allows to be read from the
    stream.

      public setOffset( $offset)
       

      Set the offset to start limiting from

      • throws RuntimeException if the stream cannot be seeked.
      public tell()
       

      Give a relative tell()
      {@inheritdoc}

      public write( $string)
      Methods
      protected createStream()
       

      Implement in subclasses to dynamically create streams when requested.

      • return StreamInterface
      • throws BadMethodCallException
      Properties
      private $limit
       
      • var int Limit the number of bytes that can be read
      private $offset
       
      • var int Offset to start reading from
      © 2020 Bruce Wells
      Search Namespaces \ Classes
      ConfigurationNumbers (0-9.) only