PHP Класс Protobuf\Stream

Автор: Fabio B. Silva ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( resource $stream, integer $size = null )
__destruct ( ) Closes the stream when the destructed
__toString ( )
create ( ) : Stream Create a new stream.
eof ( ) : boolean Returns true if the stream is at the end of the stream.
fromString ( string $resource = '', integer $size = null ) : Stream Create a new stream from a string.
getContents ( ) : string Returns the remaining contents of the stream as a string.
getSize ( ) : integer | null Get the size of the stream
read ( integer $length ) : string Read data from the stream
readStream ( integer $length ) : Stream Read stream
seek ( integer $offset, integer $whence = SEEK_SET ) Seek to a position in the stream
tell ( ) : integer Returns the current position of the file read/write pointer
wrap ( Stream | resource | string $resource = '', integer $size = null ) : Stream Wrap the input resource in a stream object.
write ( string $bytes, integer $length ) : integer Write data to the stream
writeStream ( Stream $stream, integer $length ) : integer Write stream

Описание методов

__construct() публичный Метод

public __construct ( resource $stream, integer $size = null )
$stream resource
$size integer

__destruct() публичный Метод

Closes the stream when the destructed
public __destruct ( )

__toString() публичный Метод

public __toString ( )

create() публичный статический Метод

Create a new stream.
public static create ( ) : Stream
Результат Stream

eof() публичный Метод

Returns true if the stream is at the end of the stream.
public eof ( ) : boolean
Результат boolean

fromString() публичный статический Метод

Create a new stream from a string.
public static fromString ( string $resource = '', integer $size = null ) : Stream
$resource string
$size integer
Результат Stream

getContents() публичный Метод

Returns the remaining contents of the stream as a string.
public getContents ( ) : string
Результат string

getSize() публичный Метод

Get the size of the stream
public getSize ( ) : integer | null
Результат integer | null Returns the size in bytes if known

read() публичный Метод

Read data from the stream
public read ( integer $length ) : string
$length integer
Результат string

readStream() публичный Метод

Read stream
public readStream ( integer $length ) : Stream
$length integer
Результат Stream

seek() публичный Метод

Seek to a position in the stream
public seek ( integer $offset, integer $whence = SEEK_SET )
$offset integer
$whence integer

tell() публичный Метод

Returns the current position of the file read/write pointer
public tell ( ) : integer
Результат integer

wrap() публичный статический Метод

Wrap the input resource in a stream object.
public static wrap ( Stream | resource | string $resource = '', integer $size = null ) : Stream
$resource Stream | resource | string
$size integer
Результат Stream

write() публичный Метод

Write data to the stream
public write ( string $bytes, integer $length ) : integer
$bytes string
$length integer
Результат integer

writeStream() публичный Метод

Write stream
public writeStream ( Stream $stream, integer $length ) : integer
$stream Stream
$length integer
Результат integer