Interface Guzzle\Stream\StreamInterface

Implemented byGuzzle\Http\EntityBody, Guzzle\Http\EntityBodyInterface, Guzzle\Stream\Stream

OO interface to PHP streams

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__toString() Convert the stream to a string if the stream is readable and the stream is seekable. Guzzle\Stream\StreamInterface
close() Close the underlying stream Guzzle\Stream\StreamInterface
detachStream() Detach the current stream resource Guzzle\Stream\StreamInterface
feof() Alias of isConsumed Guzzle\Stream\StreamInterface
ftell() Returns the current position of the file read/write pointer Guzzle\Stream\StreamInterface
getCustomData() Get custom data from the stream Guzzle\Stream\StreamInterface
getMetaData() Get stream metadata Guzzle\Stream\StreamInterface
getSize() Get the size of the stream if able Guzzle\Stream\StreamInterface
getStream() Get the stream resource Guzzle\Stream\StreamInterface
getStreamType() Get a label describing the underlying implementation of the stream Guzzle\Stream\StreamInterface
getUri() Get the URI/filename associated with this stream Guzzle\Stream\StreamInterface
getWrapper() Get the stream wrapper type Guzzle\Stream\StreamInterface
getWrapperData() Wrapper specific data attached to this stream. Guzzle\Stream\StreamInterface
isConsumed() Check if the stream has been consumed Guzzle\Stream\StreamInterface
isLocal() Check if the stream is a local stream vs a remote stream Guzzle\Stream\StreamInterface
isReadable() Check if the stream is readable Guzzle\Stream\StreamInterface
isRepeatable() Check if the stream is repeatable Guzzle\Stream\StreamInterface
isSeekable() Check if the string is repeatable Guzzle\Stream\StreamInterface
isWritable() Check if the stream is writable Guzzle\Stream\StreamInterface
read() Read data from the stream Guzzle\Stream\StreamInterface
readLine() Read a line from the stream up to the maximum allowed buffer length Guzzle\Stream\StreamInterface
rewind() Rewind to the beginning of the stream Guzzle\Stream\StreamInterface
seek() Seek to a position in the stream Guzzle\Stream\StreamInterface
setCustomData() Set custom data on the stream Guzzle\Stream\StreamInterface
setSize() Specify the size of the stream in bytes Guzzle\Stream\StreamInterface
setStream() Set the stream that is wrapped by the object Guzzle\Stream\StreamInterface
write() Write data to the stream Guzzle\Stream\StreamInterface

Method Details

__toString() public abstract method

Convert the stream to a string if the stream is readable and the stream is seekable.

public abstract string __toString ( )
close() public abstract method

Close the underlying stream

public abstract void close ( )
detachStream() public abstract method

Detach the current stream resource

public abstract self detachStream ( )
feof() public abstract method

Alias of isConsumed

public abstract bool feof ( )
ftell() public abstract method

Returns the current position of the file read/write pointer

public abstract int|bool ftell ( )
return int|bool

Returns the position of the file pointer or false on error

getCustomData() public abstract method

Get custom data from the stream

public abstract null|mixed getCustomData ( $key )
$key string

Key to retrieve

getMetaData() public abstract method

Get stream metadata

public abstract array|mixed|null getMetaData ( $key null )
$key string

Specific metadata to retrieve

getSize() public abstract method

Get the size of the stream if able

public abstract int|bool getSize ( )
getStream() public abstract method

Get the stream resource

public abstract resource getStream ( )
getStreamType() public abstract method

Get a label describing the underlying implementation of the stream

public abstract string getStreamType ( )
getUri() public abstract method

Get the URI/filename associated with this stream

public abstract string getUri ( )
getWrapper() public abstract method

Get the stream wrapper type

public abstract string getWrapper ( )
getWrapperData() public abstract method

Wrapper specific data attached to this stream.

public abstract array getWrapperData ( )
isConsumed() public abstract method

Check if the stream has been consumed

public abstract bool isConsumed ( )
isLocal() public abstract method

Check if the stream is a local stream vs a remote stream

public abstract bool isLocal ( )
isReadable() public abstract method

Check if the stream is readable

public abstract bool isReadable ( )
isRepeatable() public abstract method

Check if the stream is repeatable

public abstract bool isRepeatable ( )
isSeekable() public abstract method

Check if the string is repeatable

public abstract bool isSeekable ( )
isWritable() public abstract method

Check if the stream is writable

public abstract bool isWritable ( )
read() public abstract method

Read data from the stream

public abstract string|bool read ( $length )
$length int

Up to length number of bytes read.

return string|bool

Returns the data read from the stream or FALSE on failure or EOF

readLine() public abstract method

Read a line from the stream up to the maximum allowed buffer length

public abstract string|bool readLine ( $maxLength null )
$maxLength int

Maximum buffer length

rewind() public abstract method

Rewind to the beginning of the stream

public abstract bool rewind ( )
return bool

Returns true on success or false on failure

seek() public abstract method

Seek to a position in the stream

public abstract bool seek ( $offset, $whence SEEK_SET )
$offset int

Stream offset

$whence int

Where the offset is applied

return bool

Returns TRUE on success or FALSE on failure

setCustomData() public abstract method

Set custom data on the stream

public abstract self setCustomData ( $key, $value )
$key string

Key to set

$value mixed

Value to set

setSize() public abstract method

Specify the size of the stream in bytes

public abstract self setSize ( $size )
$size int

Size of the stream contents in bytes

setStream() public abstract method

Set the stream that is wrapped by the object

public abstract self setStream ( $stream, $size null )
$stream resource

Stream resource to wrap

$size int

Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.

write() public abstract method

Write data to the stream

public abstract int|bool write ( $string )
$string string

The string that is to be written.

return int|bool

Returns the number of bytes written to the stream on success or FALSE on failure.