diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Gdata/MimeBodyString.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Gdata/MimeBodyString.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,92 @@ +_sourceString = $sourceString; + $this->_bytesRead = 0; + } + + /** + * Read the next chunk of the string. + * + * @param integer $bytesRequested The size of the chunk that is to be read. + * @return string A corresponding piece of the string. + */ + public function read($bytesRequested) + { + $len = strlen($this->_sourceString); + if($this->_bytesRead == $len) { + return FALSE; + } else if($bytesRequested > $len - $this->_bytesRead) { + $bytesRequested = $len - $this->_bytesRead; + } + + $buffer = substr($this->_sourceString, $this->_bytesRead, $bytesRequested); + $this->_bytesRead += $bytesRequested; + + return $buffer; + } + + /** + * The length of the string. + * + * @return int The length of the string contained in the object. + */ + public function getSize() + { + return strlen($this->_sourceString); + } + + +}