PHP Класс ParagonIE\Halite\Stream\MutableFile

Contrast with ReadOnlyFile: does not prevent race conditions by itself This library makes heavy use of return-type declarations, which are a PHP 7 only feature. Read more about them here:
Наследование: implements ParagonIE\Halite\Contract\StreamInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( $file ) MutableFile constructor.
__destruct ( ) Make sure we invoke $this->close()
close ( ) Close the file handle.
getPos ( ) : integer Where are we in the buffer?
getSize ( ) : integer How big is this buffer?
readBytes ( integer $num, boolean $skipTests = false ) : string Read from a stream; prevent partial reads
remainingBytes ( ) : integer Get number of bytes remaining
reset ( integer $i ) : boolean Set the current cursor position to the desired location
writeBytes ( string $buf, integer $num = null ) : integer Write to a stream; prevent partial writes

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

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

MutableFile constructor.
public __construct ( $file )
$file

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

Make sure we invoke $this->close()
public __destruct ( )

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

Close the file handle.
public close ( )

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

Where are we in the buffer?
public getPos ( ) : integer
Результат integer

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

How big is this buffer?
public getSize ( ) : integer
Результат integer

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

Read from a stream; prevent partial reads
public readBytes ( integer $num, boolean $skipTests = false ) : string
$num integer
$skipTests boolean
Результат string

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

Get number of bytes remaining
public remainingBytes ( ) : integer
Результат integer

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

Set the current cursor position to the desired location
public reset ( integer $i ) : boolean
$i integer
Результат boolean

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

Write to a stream; prevent partial writes
public writeBytes ( string $buf, integer $num = null ) : integer
$buf string
$num integer (number of bytes)
Результат integer