Concrete subclass of {@link Zend_Pdf_FileParserDataSource} that provides an interface to filesystem objects.

Note that this class cannot be used for other sources that may be supported by \fopen() (through URL wrappers). It may be used for local filesystem objects only.

package Zend_Pdf
subpackage FileParser
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Pdf_FileParserDataSource

 Methods

Object constructor.

__construct(string $filePath) 

Validates the path to the file, ensures that it is readable, then opens it for reading.

Throws an exception if the file is missing or cannot be opened.

Parameters

$filePath

string

Fully-qualified path to the file.

Exceptions

\Zend_Pdf_Exception

Object destructor.

__destruct() 

Closes the file if it had been successfully opened.

inherited_from \Zend_Pdf_FileParserDataSource::__destruct()

Object destructor. Closes the data source.

__destruct() 
Inherited

May also perform cleanup tasks such as deleting temporary files.

Returns the full filesystem path of the file.

__toString() : string

Subclasses should override this method to provide a more specific description of the actual object being represented.

inherited_from \Zend_Pdf_FileParserDataSource::__toString()

Returns

string

Returns a description of the object for debugging purposes.

__toString() : string
Inherited

Subclasses should override this method to provide a more specific description of the actual object being represented.

Returns

string

Returns the byte offset of the current read position within the data source.

getOffset() : integer
Inherited

Returns

integer

Returns the total size in bytes of the data source.

getSize() : integer
Inherited

Returns

integer

Seeks the file read position to the specified byte offset.

moveToOffset(integer $offset) 

Throws an exception if the file pointer cannot be moved or if it is moved beyond EOF (end of file).

inherited_from \Zend_Pdf_FileParserDataSource::moveToOffset()

Parameters

$offset

integer

Destination byte offset.

Exceptions

\Zend_Pdf_Exception

Moves the current read position to the specified byte offset.

moveToOffset(integer $offset) 
Inherited

Throws an exception you attempt to move before the beginning or beyond the end of the data source.

If a subclass needs to perform additional tasks (such as performing a fseek() on a filesystem source), it should do so after calling this parent method.

Parameters

$offset

integer

Destination byte offset.

Exceptions

\Zend_Pdf_Exception

Returns the entire contents of the file as a string.

readAllBytes() : string

Preserves the current file seek position.

inherited_from \Zend_Pdf_FileParserDataSource::readAllBytes()

Returns

string

Returns the entire contents of the data source as a string.

readAllBytes() : string
Inherited

This method may be called at any time and so must preserve the byte offset of the read position, both through $this->_offset and whatever other additional pointers (such as the seek position of a file pointer) that might be used.

Returns

string

Returns the specified number of raw bytes from the file at the byte offset of the current read position.

readBytes(integer $byteCount) : string

Advances the read position by the number of bytes read.

Throws an exception if an error was encountered while reading the file or if there is insufficient data to completely fulfill the request.

inherited_from \Zend_Pdf_FileParserDataSource::readBytes()

Parameters

$byteCount

integer

Number of bytes to read.

Exceptions

\Zend_Pdf_Exception

Returns

string

Returns the specified number of raw bytes from the data source at the byte offset of the current read position.

readBytes(integer $byteCount) : string
Inherited

Must advance the read position by the number of bytes read by updating $this->_offset.

Throws an exception if there is insufficient data to completely fulfill the request or if an error occurs.

Parameters

$byteCount

integer

Number of bytes to read.

Exceptions

\Zend_Pdf_Exception

Returns

string

Shifts the current read position within the data source by the specified number of bytes.

skipBytes(integer $byteCount) 
Inherited

You may move forward (positive numbers) or backward (negative numbers). Throws an exception you attempt to move before the beginning or beyond the end of the data source.

Parameters

$byteCount

integer

Number of bytes to skip.

Exceptions

\Zend_Pdf_Exception

 Properties

 

Fully-qualified path to the file.

$_filePath : string

Default

''
 

File resource handle .

$_fileResource : resource

Default

null
 

Byte offset of the current read position within the data source.

$_offset : integer

Default

0
 

Total size in bytes of the data source.

$_size : integer

Default

0