Concrete subclass of {@link Zend_Pdf_FileParserDataSource} that provides an interface to binary strings.

Concrete subclasses allow for parsing of in-memory, filesystem, and other sources through a common API. These subclasses also take care of error handling and other mundane tasks.

Subclasses must implement at minimum __construct(), __destruct(), \readBytes(), and \readAllBytes(). Subclasses should also override \moveToOffset() and __toString() as appropriate.

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 $string) 

Verifies that the string is not empty.

Parameters

$string

string

String to parse.

Object destructor.

__destruct() 

May also perform cleanup tasks such as deleting temporary files.

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 a string containing the parsed string's length.

__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

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 string.

readAllBytes() : string

Preserves the current read 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 string 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 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

 

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
 

The string to parse.

$_string : string

Default

''