FileStreamReader
in package
implements
StreamReaderInterface, SeekableStreamInterface
Interfaces, Classes and Traits
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
$path
private
mixed
$path
Methods
__construct()
public
__construct(mixed $path) : mixed
Parameters
- $path : mixed
Return values
mixed —length()
public
length() : int
Return values
int —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
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
Return values
StreamInterface —tell()
Returns the current position of the pointer.
public
tell() : int