Properties

$limit

$limit : integer

Type

integer — Limit the number of bytes that can be read

$offset

$offset : integer

Type

integer — Offset to start reading from

Methods

__construct()

__construct(\Guzzle\Http\EntityBodyInterface  $body, integer  $limit, integer  $offset) 

Parameters

\Guzzle\Http\EntityBodyInterface $body

Body to wrap

integer $limit

Total number of bytes to allow to be read from the stream

integer $offset

Position to seek to before reading (only works on seekable streams)

__toString()

__toString() 

Returns only a subset of the decorated entity body when cast as a string {@inheritdoc}

__call()

__call(string  $method, array  $args) : mixed

Allow decorators to implement custom methods

Parameters

string $method

Missing method name

array $args

Method arguments

Returns

mixed

close()

close() 

setRewindFunction()

setRewindFunction(mixed  $callable) : self

Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected.

Parameters

mixed $callable

Callable to invoke to rewind a non-seekable stream. The callback must accept an EntityBodyInterface object, perform the rewind if possible, and return a boolean representing whether or not the rewind was successful.

Returns

self

rewind()

rewind() 

compress()

compress(string  $filter = 'zlib.deflate') : boolean

If the stream is readable, compress the data in the stream using deflate compression. The uncompressed stream is then closed, and the compressed stream then becomes the wrapped stream.

Parameters

string $filter

Compression filter

Returns

boolean —

Returns TRUE on success or FALSE on failure

uncompress()

uncompress(string  $filter = 'zlib.inflate') : boolean

Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.

Parameters

string $filter

De-compression filter

Returns

boolean —

Returns TRUE on success or FALSE on failure

getContentLength()

getContentLength() : integer|boolean

Returns the Content-Length of the limited subset of data {@inheritdoc}

Returns

integer|boolean —

Returns the Content-Length or false on failure

getContentType()

getContentType() : string|null

Guess the Content-Type of a local stream

Returns

string|null

getContentMd5()

getContentMd5(boolean  $rawOutput = false, boolean  $base64Encode = false) : boolean|string

Get an MD5 checksum of the stream's contents

Parameters

boolean $rawOutput

Whether or not to use raw output

boolean $base64Encode

Whether or not to base64 encode raw output (only if raw output is true)

Returns

boolean|string —

Returns an MD5 string on success or FALSE on failure

getContentEncoding()

getContentEncoding() : boolean|string

Get the Content-Encoding of the EntityBody

Returns

boolean|string

getMetaData()

getMetaData(  $key = null) 

Parameters

$key

getStream()

getStream() 

setStream()

setStream(  $stream,   $size) 

Parameters

$stream
$size

detachStream()

detachStream() 

getWrapper()

getWrapper() 

getWrapperData()

getWrapperData() 

getStreamType()

getStreamType() 

getUri()

getUri() 

getSize()

getSize() 

isReadable()

isReadable() 

isRepeatable()

isRepeatable() 

isWritable()

isWritable() 

isConsumed()

isConsumed() 

feof()

feof() 

Alias of isConsumed() {@inheritdoc}

isLocal()

isLocal() 

isSeekable()

isSeekable() 

setSize()

setSize(  $size) 

Parameters

$size

seek()

seek(  $offset,   $whence = SEEK_SET) 

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

Parameters

$offset
$whence

read()

read(  $length) 

Parameters

$length

write()

write(  $string) 

Parameters

$string

readLine()

readLine(  $maxLength = null) 

Parameters

$maxLength

ftell()

ftell() 

getCustomData()

getCustomData(  $key) 

Parameters

$key

setCustomData()

setCustomData(  $key,   $value) 

Parameters

$key
$value

setOffset()

setOffset(integer  $offset) : self

Set the offset to start limiting from

Parameters

integer $offset

Offset to seek to and begin byte limiting from

Returns

self

setLimit()

setLimit(integer  $limit) : self

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

Parameters

integer $limit

Total number of bytes to allow to be read from the stream

Returns

self