File indexing completed on 2024-12-22 05:36:46

0001 <?php
0002 
0003 /**
0004  * Zend Framework
0005  *
0006  * LICENSE
0007  *
0008  * This source file is subject to the new BSD license that is bundled
0009  * with this package in the file LICENSE.txt.
0010  * It is also available through the world-wide-web at this URL:
0011  * http://framework.zend.com/license/new-bsd
0012  * If you did not receive a copy of the license and are unable to
0013  * obtain it through the world-wide-web, please send an email
0014  * to license@zend.com so we can send you a copy immediately.
0015  *
0016  * @category   Zend
0017  * @package    Zend_Gdata
0018  * @subpackage Gdata
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  * @version    $Id$
0022  */
0023 
0024 /**
0025  * A wrapper for strings for buffered reading.
0026  *
0027  * @category   Zend
0028  * @package    Zend_Gdata
0029  * @subpackage Gdata
0030  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0031  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0032  */
0033 class Zend_Gdata_MimeFile
0034 {
0035 
0036     /**
0037      * A handle to the file that is part of the message.
0038      *
0039      * @var resource
0040      */
0041     protected $_fileHandle = null;
0042 
0043     /**
0044      * Create a new MimeFile object.
0045      *
0046      * @param string $fileHandle An open file handle to the file being
0047      *               read.
0048      */
0049     public function __construct($fileHandle)
0050     {
0051         $this->_fileHandle = $fileHandle;
0052     }
0053 
0054     /**
0055      * Read the next chunk of the file.
0056      *
0057      * @param integer $bytesRequested The size of the chunk that is to be read.
0058      * @return string A corresponding piece of the message. This could be
0059      *                binary or regular text.
0060      */
0061     public function read($bytesRequested)
0062     {
0063       return fread($this->_fileHandle, $bytesRequested);
0064     }
0065 
0066 }