Zend Framework  1.12
Public Member Functions | Protected Attributes | List of all members
Zend_Pdf_FileParserDataSource Class Reference

Public Member Functions

 __destruct ()
 Object destructor.
 
 readBytes ($byteCount)
 Returns the specified number of raw bytes from the data source at the byte offset of the current read position.
 
 readAllBytes ()
 Returns the entire contents of the data source as a string.
 
 __toString ()
 Returns a description of the object for debugging purposes.
 
 getOffset ()
 Returns the byte offset of the current read position within the data source.
 
 getSize ()
 Returns the total size in bytes of the data source.
 
 moveToOffset ($offset)
 Moves the current read position to the specified byte offset.
 
 skipBytes ($byteCount)
 Shifts the current read position within the data source by the specified number of bytes.
 

Protected Attributes

 $_size = 0
 
 $_offset = 0
 

Constructor & Destructor Documentation

__destruct ( )
abstract

Object destructor.

Closes the data source.

May also perform cleanup tasks such as deleting temporary files.

Member Function Documentation

__toString ( )

Returns a description of the object for debugging purposes.

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

Returns
string
getOffset ( )

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

Returns
integer
getSize ( )

Returns the total size in bytes of the data source.

Returns
integer
moveToOffset (   $offset)

Moves the current read position to the specified byte 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.

Parameters
integer$offsetDestination byte offset.
Exceptions
Zend_Pdf_Exception
readAllBytes ( )
abstract

Returns the entire contents of the data source as a 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.

Returns
string
readBytes (   $byteCount)
abstract

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

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
integer$byteCountNumber of bytes to read.
Returns
string
Exceptions
Zend_Pdf_Exception
skipBytes (   $byteCount)

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

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
integer$byteCountNumber of bytes to skip.
Exceptions
Zend_Pdf_Exception

Member Data Documentation

$_offset = 0
protected
$_size = 0
protected