## API Documentation

# Gdata/MediaMimeStream.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
  Zend
copyright
  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
license
  New BSD License
package
  Zend_Gdata
subpackage
  Gdata
version
  $Id: MediaMimeStream.php 23775 2011-03-01 17:25:24Z ralph $

## \Zend_Gdata_MediaMimeStream
jump to top

A streaming Media MIME class that allows for buffered read operations.

category
  Zend
copyright
  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
license
  New BSD License
package
  Zend_Gdata
subpackage
  Gdata

### Properties

`string $_boundaryString= 'null'`

A valid MIME boundary.

Default value `null` Details

Type
  string

`integer $_currentPart= '0'`

The current part being read from.

Default value `0` Details

Type
  integer

`resource $_fileHandle= 'null'`

A handle to the file that is part of the message.

Default value `null` Details

Type
  resource

`array $_parts= 'null'`

An array of all the parts to be sent. Array members are either a MimeFile or a MimeBodyString object.

Default value `null` Details

Type
  array

`integer $_totalSize= '0'`

The size of the MIME message.

Default value `0` Details

Type
  integer

### Methods

`__construct( string $xmlString = null, string $filePath = null, string $fileContentType = null ) : void`

Create a new MimeMediaStream object.

Parameters

Name | Type | Description
--- | --- | ---
$xmlString | string | The string corresponding to the XML section of the message, typically an atom entry or feed.
$filePath | string | The path to the file that constitutes the binary part of the message.
$fileContentType | string | The valid internet media type of the file.

Throws

Exception | Description
--- | ---
\Zend_Gdata_App_IOException | If the file cannot be read or does not exist. Also if mbstring.func_overload has been set > 1.

`closeFileHandle( ) : void`

Close the internal file that we are streaming to the socket.

`getContentType( ) : string`

Return a Content-type header that includes the current boundary string.

Returns

Type | Description
--- | ---
string | A valid HTTP Content-Type header.

`getTotalSize( ) : integer`

Return the total size of the mime message.

Returns

Type | Description
--- | ---
integer | Total size of the message to be sent.

`read( $bytesRequested ) : string`

Read a specific chunk of the the MIME multipart message.

Parameters

Name | Type | Description
--- | --- | ---
$bytesRequested |  |

Returns

Type | Description
--- | ---
string | A corresponding piece of the message. This could be binary or regular text.

`wrapEntry( $entry, $fileMimeType ) : void`

Sandwiches the entry body into a MIME message

Parameters

Name | Type | Description
--- | --- | ---
$entry |  |
$fileMimeType |  |

Documentation was generated by DocBlox 0.13.3.