class BufferStreamHandler

Generic Buffer stream handler

This class provides a generic buffer stream. It can be used to store/retrieve/manipulate string buffers with the standard PHP filesystem I/O methods.

Properties

integer $position Stream position
string $name Buffer name
array $buffers Buffer hash

Methods

static  void
stream_register()

Function to register the stream wrapper

boolean
stream_open( string $path, string $mode, integer $options, string $opened_path)

Function to open file or url

mixed
stream_read( integer $count)

Read stream

integer
stream_write( string $data)

Write stream

integer
stream_tell()

Function to get the current position of the stream

boolean
stream_eof()

Function to test for end of file pointer

boolean
stream_seek( integer $offset, integer $whence)

The read write position updates in response to $offset and $whence

Details

static void stream_register()

Function to register the stream wrapper

Return Value

void

boolean stream_open( string $path, string $mode, integer $options, string $opened_path)

Function to open file or url

Parameters

string $path The URL that was passed
string $mode Mode used to open the file see fopen
integer $options Flags used by the API, may be STREAMUSEPATH and STREAMREPORTERRORS
string $opened_path &$openedpath Full path of the resource. Used with STREANUSE_PATH option

Return Value

boolean

See also

streamWrapper::stream_open

mixed stream_read( integer $count)

Read stream

Parameters

integer $count How many bytes of data from the current position should be returned.

Return Value

mixed The data from the stream up to the specified number of bytes (all data if the total number of bytes in the stream is less than $count. Null if the stream is empty.

See also

streamWrapper::stream_read

integer stream_write( string $data)

Write stream

Parameters

string $data The data to write to the stream.

Return Value

integer

See also

streamWrapper::stream_write

integer stream_tell()

Function to get the current position of the stream

Return Value

integer

See also

streamWrapper::stream_tell

boolean stream_eof()

Function to test for end of file pointer

Return Value

boolean True if the pointer is at the end of the stream

See also

streamWrapper::stream_eof

boolean stream_seek( integer $offset, integer $whence)

The read write position updates in response to $offset and $whence

Parameters

integer $offset The offset in bytes
integer $whence Position the offset is added to Options are SEEKSET, SEEKCUR, and SEEK_END

Return Value

boolean True if updated

See also

streamWrapper::stream_seek