Documentation

FileStreamReader
in package
implements StreamReaderInterface, SeekableStreamInterface

Interfaces, Classes and Traits

StreamReaderInterface
SeekableStreamInterface

Table of Contents

$fh  : resource|false
The file handle used to stream from the drive to the application. If the application was unable to open the stream reading it will yield a file permissions exception.
$path  : mixed
__construct()  : mixed
length()  : int
read()  : string
Reads up to a given amount of bytes from the file. Please note that if the file has been completely read or it's length is shorter than the amount provided, it will return the entire remaining file.
seek()  : StreamInterface
Moves the file read pointer to the given address. The offset is given in bytes from the start of the file.
tell()  : int
Returns the current position of the pointer.

Properties

$fh

The file handle used to stream from the drive to the application. If the application was unable to open the stream reading it will yield a file permissions exception.

private resource|false $fh

Methods

__construct()

public __construct(mixed $path) : mixed
Parameters
$path : mixed
Return values
mixed

read()

Reads up to a given amount of bytes from the file. Please note that if the file has been completely read or it's length is shorter than the amount provided, it will return the entire remaining file.

public read([mixed $length = null ]) : string

The standard amount to be read is 8MB.

Parameters
$length : mixed = null
Tags
throws
FilePermissionsException
Return values
string

seek()

Moves the file read pointer to the given address. The offset is given in bytes from the start of the file.

public seek(int $position) : StreamInterface
Parameters
$position : int
Tags
throws
FilePermissionsException
Return values
StreamInterface

tell()

Returns the current position of the pointer.

public tell() : int
Return values
int

Search results