PHP Class Swift_ByteStream_FileByteStream, Halite

Author: Chris Corbyn
Inheritance: extends Swift_ByteStream_AbstractFilterableInputStream, implements Swift_FileStream
Afficher le fichier Open project: HaliteChallenge/Halite Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $path, boolean $writable = false ) Create a new FileByteStream for $path.
getPath ( ) : string Get the complete path to the file.
read ( integer $length ) : string | boolean Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
setReadPointer ( integer $byteOffset ) : boolean Move the internal read pointer to $byteOffset in the stream.

Méthodes protégées

Méthode Description
_commit ( $bytes ) Just write the bytes to the file
_flush ( ) Not used

Private Methods

Méthode Description
_copyReadStream ( ) Copy a readOnly Stream to ensure seekability
_getReadHandle ( ) Get the resource for reading
_getReadStreamSeekableStatus ( ) Check if ReadOnly Stream is seekable
_getWriteHandle ( ) Get the resource for writing
_resetReadHandle ( ) Force a reload of the resource for reading
_seekReadStreamToPosition ( $offset ) Streams in a readOnly stream ensuring copy if needed

Method Details

__construct() public méthode

Create a new FileByteStream for $path.
public __construct ( string $path, boolean $writable = false )
$path string
$writable boolean if true

_commit() protected méthode

Just write the bytes to the file
protected _commit ( $bytes )

_flush() protected méthode

Not used
protected _flush ( )

getPath() public méthode

Get the complete path to the file.
public getPath ( ) : string
Résultat string

read() public méthode

If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.
public read ( integer $length ) : string | boolean
$length integer
Résultat string | boolean

setReadPointer() public méthode

Move the internal read pointer to $byteOffset in the stream.
public setReadPointer ( integer $byteOffset ) : boolean
$byteOffset integer
Résultat boolean