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 |
__construct(string $string)
Verifies that the string is not empty.
string
String to parse.
__destruct()
May also perform cleanup tasks such as deleting temporary files.
inherited_from | \Zend_Pdf_FileParserDataSource::__destruct() |
---|
__destruct()
May also perform cleanup tasks such as deleting temporary files.
__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() |
---|
string
__toString() : string
Subclasses should override this method to provide a more specific description of the actual object being represented.
string
getOffset() : integer
integer
getSize() : integer
integer
moveToOffset(integer $offset)
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.
integer
Destination byte offset.
\Zend_Pdf_Exception |
---|
readAllBytes() : string
Preserves the current read position.
inherited_from | \Zend_Pdf_FileParserDataSource::readAllBytes() |
---|
string
readAllBytes() : string
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.
string
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() |
---|
integer
Number of bytes to read.
\Zend_Pdf_Exception |
---|
string
readBytes(integer $byteCount) : string
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.
integer
Number of bytes to read.
\Zend_Pdf_Exception |
---|
string
skipBytes(integer $byteCount)
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.
integer
Number of bytes to skip.
\Zend_Pdf_Exception |
---|
$_offset : integer
0
$_size : integer
0
$_string : string
''