SeekableFileContent
in package
implements
FileContent
Default implementation for file contents based on simple strings.
Tags
Interfaces, Classes and Traits
- FileContent
- Interface for actual file contents.
Table of Contents
- $offset : mixed
- current position within content
- bytesRead() : int
- for backwards compatibility with vfsStreamFile::bytesRead()
- eof() : bool
- checks whether pointer is at end of file
- read() : string
- reads the given amount of bytes from content
- readUntilEnd() : string
- for backwards compatibility with vfsStreamFile::readUntilEnd()
- seek() : bool
- seeks to the given offset
- write() : int
- writes an amount of data
- doRead() : mixed
- actual reading of given byte count starting at given offset
- doWrite() : mixed
- actual writing of data with specified length at given offset
Properties
$offset
current position within content
private
mixed
$offset
= 0
Tags
Methods
bytesRead()
for backwards compatibility with vfsStreamFile::bytesRead()
public
bytesRead() : int
Tags
Return values
int —eof()
checks whether pointer is at end of file
public
eof() : bool
Return values
bool —read()
reads the given amount of bytes from content
public
read(int $count) : string
Parameters
- $count : int
Return values
string —readUntilEnd()
for backwards compatibility with vfsStreamFile::readUntilEnd()
public
readUntilEnd() : string
Tags
Return values
string —seek()
seeks to the given offset
public
seek(int $offset, int $whence) : bool
Parameters
- $offset : int
- $whence : int
Return values
bool —write()
writes an amount of data
public
write(string $data) : int
Parameters
- $data : string
Return values
int —amount of written bytes
doRead()
actual reading of given byte count starting at given offset
protected
abstract doRead(int $offset, int $count) : mixed
Parameters
- $offset : int
- $count : int
Return values
mixed —doWrite()
actual writing of data with specified length at given offset
protected
abstract doWrite(string $data, int $offset, int $length) : mixed
Parameters
- $data : string
- $offset : int
- $length : int