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
Datei anzeigen Open project: paragonie/halite Class Usage Examples

Public Methods

Method 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 method

MutableFile constructor.
public __construct ( $file )
$file

__destruct() public method

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

close() public method

Close the file handle.
public close ( )

getPos() public method

Where are we in the buffer?
public getPos ( ) : integer
return integer

getSize() public method

How big is this buffer?
public getSize ( ) : integer
return integer

readBytes() public method

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

remainingBytes() public method

Get number of bytes remaining
public remainingBytes ( ) : integer
return integer

reset() public method

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

writeBytes() public method

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