PHP Class 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:
Inheritance: implements ParagonIE\Halite\Contract\StreamInterface
Afficher le fichier Open project: paragonie/halite Class Usage Examples

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

MutableFile constructor.
public __construct ( $file )
$file

__destruct() public méthode

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

close() public méthode

Close the file handle.
public close ( )

getPos() public méthode

Where are we in the buffer?
public getPos ( ) : integer
Résultat integer

getSize() public méthode

How big is this buffer?
public getSize ( ) : integer
Résultat integer

readBytes() public méthode

Read from a stream; prevent partial reads
public readBytes ( integer $num, boolean $skipTests = false ) : string
$num integer
$skipTests boolean
Résultat string

remainingBytes() public méthode

Get number of bytes remaining
public remainingBytes ( ) : integer
Résultat integer

reset() public méthode

Set the current cursor position to the desired location
public reset ( integer $i ) : boolean
$i integer
Résultat boolean

writeBytes() public méthode

Write to a stream; prevent partial writes
public writeBytes ( string $buf, integer $num = null ) : integer
$buf string
$num integer (number of bytes)
Résultat integer