Properties

$remoteStream

$remoteStream : \Guzzle\Http\EntityBody

Type

\Guzzle\Http\EntityBody — Remote stream used to actually pull data onto the buffer

$skipReadBytes

$skipReadBytes : integer

Type

integer — The number of bytes to skip reading due to a write on the temporary buffer

Methods

__construct()

__construct(\Guzzle\Http\EntityBodyInterface  $body) 

We will treat the buffer object as the body of the entity body {@inheritdoc}

Parameters

\Guzzle\Http\EntityBodyInterface $body

Entity body to decorate

__toString()

__toString() : string

Will give the contents of the buffer followed by the exhausted remote stream.

Warning: Loads the entire stream into memory

Returns

string

__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() 

Close both the remote stream and buffer stream

setRewindFunction()

setRewindFunction(mixed  $callable) : self

Does not support custom rewind functions

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.

Throws

\Guzzle\Common\Exception\RuntimeException

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

Get the Content-Length of the entity body if possible (alias of getSize)

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) 

Parameters

$offset
$whence

Throws

\Guzzle\Common\Exception\RuntimeException

When seeking with SEEK_END or when seeking past the total size of the buffer stream

read()

read(  $length) 

Parameters

$length

write()

write(  $string) 

Parameters

$string

readLine()

readLine(  $maxLength = null) 

Parameters

$maxLength

ftell()

ftell() 

getCustomData()

getCustomData(  $key) 

Always retrieve custom data from the remote stream {@inheritdoc}

Parameters

$key

setCustomData()

setCustomData(  $key,   $value) 

Always set custom data on the remote stream {@inheritdoc}

Parameters

$key
$value