/**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $descriptionRecordsCount = count($this->_descriptionRecords);
     $descriptionRecordsWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $descriptionRecordsCount; $i++) {
         $descriptionRecordsWriter->writeUInt16LE($this->_descriptionRecords[$i]['languageIndex'])->writeUInt16LE($this->_descriptionRecords[$i]['streamNumber'])->writeUInt16LE(strlen($name = iconv($this->getOption('encoding'), 'utf-16le', $this->_descriptionRecords[$i]['name']) . ""));
         if (is_string($this->_descriptionRecords[$i]['data'])) {
             $chunks = array();
             if (preg_match("/^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{1" . "2}\$/i", $this->_descriptionRecords[$i]['data'])) {
                 $descriptionRecordsWriter->writeUInt16LE(6)->writeUInt32LE(16)->write($name)->writeGuid($this->_descriptionRecords[$i]['data']);
             } else {
                 /* There is no way to distinguish byte arrays from unicode
                  * strings and hence the need for a list of fields of type
                  * byte array */
                 static $byteArray = array("WM/Lyrics_Synchronised", "WM/Picture");
                 // TODO: Add to the list if you encounter one
                 if (in_array($name, $byteArray)) {
                     $descriptionRecordsWriter->writeUInt16LE(1)->writeUInt32LE(strlen($this->_descriptionRecords[$i]['data']))->write($name)->write($this->_descriptionRecords[$i]['data']);
                 } else {
                     $value = iconv($this->getOption('encoding'), 'utf-16le', $this->_descriptionRecords[$i]['data']);
                     $value = $value ? $value . "" : '';
                     $descriptionRecordsWriter->writeUInt16LE(0)->writeUInt32LE(strlen($value))->write($name)->writeString16($value);
                 }
             }
         } else {
             if (is_bool($this->_descriptionRecords[$i]['data'])) {
                 $descriptionRecordsWriter->writeUInt16LE(2)->writeUInt32LE(2)->write($name)->writeUInt16LE($this->_descriptionRecords[$i]['data'] ? 1 : 0);
             } else {
                 if (is_int($this->_descriptionRecords[$i]['data'])) {
                     $descriptionRecordsWriter->writeUInt16LE(3)->writeUInt32LE(4)->write($name)->writeUInt32LE($this->_descriptionRecords[$i]['data']);
                 } else {
                     if (is_float($this->_descriptionRecords[$i]['data'])) {
                         $descriptionRecordsWriter->writeUInt16LE(4)->writeUInt32LE(8)->write($name)->writeInt64LE($this->_descriptionRecords[$i]['data']);
                     } else {
                         // Invalid value and there is nothing to be done
                         require_once 'Zend/Media/Asf/Exception.php';
                         throw new Zend_Media_Asf_Exception('Invalid data type');
                     }
                 }
             }
         }
     }
     $this->setSize(24 + 2 + $descriptionRecordsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($descriptionRecordsCount)->write($descriptionRecordsWriter->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     $contentEncryptionRecordsCount = count($this->_contentEncryptionRecords);
     $contentEncryptionRecordsWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $contentEncryptionRecordsCount; $i++) {
         $contentEncryptionRecordsWriter->writeGuid($this->_contentEncryptionRecords['systemId'])->writeUInt32LE($this->_contentEncryptionRecords['systemVersion'])->writeUInt16LE($encryptedObjectRecordCount = $this->_contentEncryptionRecords['streamNumbers']);
         for ($j = 0; $j < $encryptedObjectRecordCount; $j++) {
             $contentEncryptionRecordsWriter->writeUInt16LE(1)->writeUInt16LE(2)->writeUInt16LE($this->_contentEncryptionRecords['streamNumbers'][$j]);
         }
         $contentEncryptionRecordsWriter->writeUInt32LE(strlen($this->_contentEncryptionRecords['data']))->write($this->_contentEncryptionRecords['data']);
     }
     $this->setSize(24 + 2 + $contentEncryptionRecordsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($contentEncryptionRecordsCount)->write($contentEncryptionRecordsWriter->toString());
 }
Example #3
0
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $typeSpecificData = new Zend_Io_StringWriter();
     switch ($this->_streamType) {
         case self::AUDIO_MEDIA:
             $typeSpecificData->writeUInt16LE($this->_typeSpecificData['codecId'])->writeUInt16LE($this->_typeSpecificData['numberOfChannels'])->writeUInt32LE($this->_typeSpecificData['samplesPerSecond'])->writeUInt32LE($this->_typeSpecificData['avgNumBytesPerSecond'])->writeUInt16LE($this->_typeSpecificData['blockAlignment'])->writeUInt16LE($this->_typeSpecificData['bitsPerSample'])->writeUInt16LE(strlen($this->_typeSpecificData['codecSpecificData']))->write($this->_typeSpecificData['codecSpecificData']);
             break;
         case self::VIDEO_MEDIA:
             $typeSpecificData->writeUInt32LE($this->_typeSpecificData['encodedImageWidth'])->writeUInt32LE($this->_typeSpecificData['encodedImageHeight'])->writeInt8($this->_typeSpecificData['reservedFlags'])->writeUInt16LE(0)->writeUInt32LE(38 + strlen($this->_typeSpecificData['codecSpecificData']))->writeUInt32LE($this->_typeSpecificData['imageWidth'])->writeUInt32LE($this->_typeSpecificData['imageHeight'])->writeUInt16LE($this->_typeSpecificData['reserved'])->writeUInt16LE($this->_typeSpecificData['bitsPerPixelCount'])->writeUInt32LE($this->_typeSpecificData['compressionId'])->writeUInt32LE($this->_typeSpecificData['imageSize'])->writeUInt32LE($this->_typeSpecificData['horizontalPixelsPerMeter'])->writeUInt32LE($this->_typeSpecificData['verticalPixelsPerMeter'])->writeUInt32LE($this->_typeSpecificData['colorsUsedCount'])->writeUInt32LE($this->_typeSpecificData['importantColorsCount'])->write($this->_typeSpecificData['codecSpecificData']);
             break;
         case self::JFIF_MEDIA:
             $typeSpecificData->writeUInt32LE($this->_typeSpecificData['imageWidth'])->writeUInt32LE($this->_typeSpecificData['imageHeight'])->writeUInt32LE(0);
             break;
         case self::DEGRADABLE_JPEG_MEDIA:
             $typeSpecificData->writeUInt32LE($this->_typeSpecificData['imageWidth'])->writeUInt32LE($this->_typeSpecificData['imageHeight'])->writeUInt16LE(0)->writeUInt16LE(0)->writeUInt16LE(0);
             $interchangeDataSize = strlen($this->_typeSpecificData['interchangeData']);
             if ($interchangeDataSize == 1) {
                 $interchangeDataSize = 0;
             }
             $typeSpecificData->writeUInt16LE($interchangeDataSize)->write($this->_typeSpecificData['interchangeData']);
             break;
         case self::FILE_TRANSFER_MEDIA:
             // break intentionally omitted
         // break intentionally omitted
         case self::BINARY_MEDIA:
             $typeSpecificData->writeGuid($this->_typeSpecificData['majorMediaType'])->writeGuid($this->_typeSpecificData['mediaSubtype'])->writeUInt32LE($this->_typeSpecificData['fixedSizeSamples'])->writeUInt32LE($this->_typeSpecificData['temporalCompression'])->writeUInt32LE($this->_typeSpecificData['sampleSize'])->writeGuid($this->_typeSpecificData['formatType'])->writeUInt32LE(strlen($this->_typeSpecificData['formatData']))->write($this->_typeSpecificData['formatData']);
             break;
         case self::COMMAND_MEDIA:
             // break intentionally omitted
         // break intentionally omitted
         default:
             break;
     }
     $errorCorrectionData = new Zend_Io_StringWriter();
     switch ($this->_errorCorrectionType) {
         case self::AUDIO_SPREAD:
             $errorCorrectionData->writeInt8($this->_errorCorrectionData['span'])->writeUInt16LE($this->_errorCorrectionData['virtualPacketLength'])->writeUInt16LE($this->_errorCorrectionData['virtualChunkLength'])->writeUInt16LE(strlen($this->_errorCorrectionData['silenceData']))->write($this->_errorCorrectionData['silenceData']);
             break;
         case self::NO_ERROR_CORRECTION:
             // break intentionally omitted
         // break intentionally omitted
         default:
             break;
     }
     $this->setSize(24 + 54 + $typeSpecificData->getSize() + $errorCorrectionData->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_streamType)->writeGuid($this->_errorCorrectionType)->writeInt64LE($this->_timeOffset)->writeUInt32LE($typeSpecificData->getSize())->writeUInt32LE($errorCorrectionData->getSize())->writeUInt16LE($this->_flags)->writeUInt32LE($this->_reserved)->write($typeSpecificData->toString())->write($errorCorrectionData->toString());
 }
Example #4
0
 /**
  * Writes the frame raw data without the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $tmp = new Zend_Io_StringWriter();
     $tmp->writeUInt32BE($this->_bufferSize);
     $writer->write(substr($tmp->toString(), 1, 3))->writeInt8($this->_infoFlags)->writeInt32BE($this->_offset);
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $commandTypes = array();
     foreach ($this->_commands as $command) {
         if (!in_array($command['type'], $commandTypes)) {
             $commandTypes[] = $command['type'];
         }
     }
     $commandTypesCount = count($commandTypes);
     $commandTypesWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $commandTypesCount; $i++) {
         $commandTypesWriter->writeUInt16LE(strlen($commandType = iconv($this->getOption('encoding'), 'utf-16le', $commandTypes[$i])) / 2)->write($commandType);
     }
     $commandsCount = count($this->_commands);
     $commandsWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $commandsCount; $i++) {
         $commandsWriter->writeUInt32LE($this->_commands[$i]['presentationTime'])->writeUInt16LE(array_search($this->_commands[$i]['type'], $commandTypes))->writeUInt16LE(strlen($command = iconv($this->getOption('encoding'), 'utf-16le', $this->_commands[$i]['name'])) / 2)->write($command);
     }
     $this->setSize(24 + 20 + $commandTypesWriter->getSize() + $commandsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_reserved)->writeUInt16LE($commandsCount)->writeUInt16LE($commandTypesCount)->write($commandTypesWriter->toString())->write($commandsWriter->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $buffer = new Zend_Io_StringWriter();
     $buffer->writeUInt32LE(strlen($this->_secretData))->write($this->_secretData)->writeUInt32LE($len = strlen($this->_protectionType) + 1)->writeString8($this->_protectionType, $len)->writeUInt32LE($len = strlen($this->_keyId) + 1)->writeString8($this->_keyId, $len)->writeUInt32LE($len = strlen($this->_licenseUrl) + 1)->writeString8($this->_licenseUrl, $len);
     $this->setSize(24 + $buffer->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->write($buffer->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     $contentDescriptorsCount = count($this->_contentDescriptors);
     $contentDescriptorsWriter = new Zend_Io_StringWriter();
     foreach ($this->_contentDescriptors as $name => $value) {
         $descriptor = iconv($this->getOption('encoding'), 'utf-16le', $name ? $name . "" : '');
         $contentDescriptorsWriter->writeUInt16LE(strlen($descriptor))->writeString16($descriptor);
         if (is_string($value)) {
             /* There is no way to distinguish byte arrays from unicode
              * strings and hence the need for a list of fields of type
              * byte array */
             static $byteArray = array("WM/MCDI", "WM/UserWebURL", "WM/Lyrics_Synchronised", "WM/Picture");
             // TODO: Add to the list if you encounter one
             if (in_array($descriptor, $byteArray)) {
                 $contentDescriptorsWriter->writeUInt16LE(1)->writeUInt16LE(strlen($value))->write($value);
             } else {
                 $value = iconv($this->getOption('encoding'), 'utf-16le', $value) . "";
                 $contentDescriptorsWriter->writeUInt16LE(0)->writeUInt16LE(strlen($value))->writeString16($value);
             }
         } else {
             if (is_bool($value)) {
                 $contentDescriptorsWriter->writeUInt16LE(2)->writeUInt16LE(4)->writeUInt32LE($value ? 1 : 0);
             } else {
                 if (is_int($value)) {
                     $contentDescriptorsWriter->writeUInt16LE(3)->writeUInt16LE(4)->writeUInt32LE($value);
                 } else {
                     if (is_float($value)) {
                         $contentDescriptorsWriter->writeUInt16LE(4)->writeUInt16LE(8)->writeInt64LE($value);
                     } else {
                         // Invalid value and there is nothing to be done
                         throw new Zend_Media_Asf_Exception('Invalid data type');
                     }
                 }
             }
         }
     }
     $this->setSize(24 + 2 + $contentDescriptorsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($contentDescriptorsCount)->write($contentDescriptorsWriter->toString());
 }
Example #8
0
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     $descriptionRecordsCount = count($this->_descriptionRecords);
     $descriptionRecordsWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $descriptionRecordsCount; $i++) {
         $descriptionRecordsWriter->writeUInt16LE(0)->writeUInt16LE($this->_descriptionRecords[$i]['streamNumber'])->writeUInt16LE(strlen($name = iconv($this->getOption('encoding'), 'utf-16le', $this->_descriptionRecords[$i]['name']) . ""));
         if (is_string($this->_descriptionRecords[$i]['data'])) {
             /* There is no way to distinguish byte arrays from unicode
              * strings and hence the need for a list of fields of type byte
              * array */
             static $byteArray = array('');
             // TODO: Add to the list if you encounter one
             if (in_array($name, $byteArray)) {
                 $descriptionRecordsWriter->writeUInt16LE(1)->writeUInt32LE(strlen($this->_descriptionRecords[$i]['data']))->write($name)->write($this->_descriptionRecords[$i]['data']);
             } else {
                 $value = iconv($this->getOption('encoding'), 'utf-16le', $this->_descriptionRecords[$i]['data']);
                 $value = $value ? $value . "" : '';
                 $descriptionRecordsWriter->writeUInt16LE(0)->writeUInt32LE(strlen($value))->write($name)->writeString16($value);
             }
         } else {
             if (is_bool($this->_descriptionRecords[$i]['data'])) {
                 $descriptionRecordsWriter->writeUInt16LE(2)->writeUInt32LE(2)->write($name)->writeUInt16LE($this->_descriptionRecords[$i]['data'] ? 1 : 0);
             } else {
                 if (is_int($this->_descriptionRecords[$i]['data'])) {
                     $descriptionRecordsWriter->writeUInt16LE(3)->writeUInt32LE(4)->write($name)->writeUInt32LE($this->_descriptionRecords[$i]['data']);
                 } else {
                     if (is_float($this->_descriptionRecords[$i]['data'])) {
                         $descriptionRecordsWriter->writeUInt16LE(4)->writeUInt32LE(8)->write($name)->writeInt64LE($this->_descriptionRecords[$i]['data']);
                     } else {
                         // Invalid value and there is nothing to be done
                         throw new Zend_Media_Asf_Exception('Invalid data type');
                     }
                 }
             }
         }
     }
     $this->setSize(24 + 2 + $descriptionRecordsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($descriptionRecordsCount)->write($descriptionRecordsWriter->toString());
 }
Example #9
0
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $codecEntriesCount = count($this->_entries);
     $codecEntriesWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $codecEntriesCount; $i++) {
         $codecEntriesWriter->writeUInt16LE($this->_entries[$i]['type'])->writeUInt16LE(strlen($codecName = iconv($this->getOption('encoding'), 'utf-16le', $this->_entries[$i]['codecName']) . "") / 2)->writeString16($codecName)->writeUInt16LE(strlen($codecDescription = iconv($this->getOption('encoding'), 'utf-16le', $this->_entries[$i]['codecDescription']) . "") / 2)->writeString16($codecDescription)->writeUInt16LE(strlen($this->_entries[$i]['codecInformation']))->write($this->_entries[$i]['codecInformation']);
     }
     $this->setSize(24 + 20 + $codecEntriesWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_reserved)->writeUInt32LE($codecEntriesCount)->write($codecEntriesWriter->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $languageIdRecordsCount = count($this->_languages);
     $languageIdRecordsWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $languageIdRecordsCount; $i++) {
         $languageIdRecordsWriter->writeInt8(strlen($languageId = iconv($this->getOption('encoding'), 'utf-16le', $this->_languages[$i]) . ""))->writeString16($languageId);
     }
     $this->setSize(24 + 2 + $languageIdRecordsWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($languageIdRecordsCount)->write($languageIdRecordsWriter->toString());
 }
Example #11
0
 /**
  * Writes the frame data with the header.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     /* ID3v2.3.0 Flags; convert from 2.4.0 format */
     if ($this->getOption('version', 4) < 4) {
         $flags = 0;
         if ($this->hasFlag(self::DISCARD_ON_TAGCHANGE)) {
             $flags = $flags | 0x8000;
         }
         if ($this->hasFlag(self::DISCARD_ON_FILECHANGE)) {
             $flags = $flags | 0x4000;
         }
         if ($this->hasFlag(self::READ_ONLY)) {
             $flags = $flags | 0x2000;
         }
         if ($this->hasFlag(self::COMPRESSION)) {
             $flags = $flags | 0x80;
         }
         if ($this->hasFlag(self::ENCRYPTION)) {
             $flags = $flags | 0x40;
         }
         if ($this->hasFlag(self::GROUPING_IDENTITY)) {
             $flags = $flags | 0x20;
         }
     } else {
         $flags = $this->_flags;
     }
     $this->_writeData($buffer = new Zend_Io_StringWriter());
     $data = $buffer->toString();
     $size = $this->_size = strlen($data);
     // ID3v2.4.0 supports frame level unsynchronisation. The corresponding
     // option is set to true when any of the frames use the
     // unsynchronisation scheme. The usage is denoted by
     // Zend_Media_Id3_Header flag that is set accordingly upon file write.
     if ($this->getOption('version', 4) >= 4) {
         $data = $this->_encodeUnsynchronisation($data);
         if (($dataLength = strlen($data)) != $size) {
             $size = 4 + $dataLength;
             $flags |= self::DATA_LENGTH_INDICATOR | self::UNSYNCHRONISATION;
             $this->setOption('unsynchronisation', true);
         } else {
             $flags &= ~(self::DATA_LENGTH_INDICATOR | self::UNSYNCHRONISATION);
         }
     }
     $writer->writeString8(substr($this->_identifier, 0, 4), 4, " ")->writeUInt32BE($this->getOption('version', 4) < 4 ? $size : $this->_encodeSynchsafe32($size))->writeUInt16BE($flags);
     if (($flags & self::DATA_LENGTH_INDICATOR) == self::DATA_LENGTH_INDICATOR) {
         $writer->writeUInt32BE($this->getOption('version', 4) < 4 ? $this->_size : $this->_encodeSynchsafe32($this->_size));
     }
     $writer->write($data);
 }
Example #12
0
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $name = iconv($this->getOption('encoding'), 'utf-16le', $this->_name) . "";
     $markersCount = count($this->_markers);
     $markersWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $markersCount; $i++) {
         $markersWriter->writeInt64LE($this->_markers[$i]['offset'])->writeInt64LE($this->_markers[$i]['presentationTime'])->writeUInt16LE(12 + ($descriptionLength = strlen($description = iconv('utf-16le', $this->getOption('encoding'), $this->_markers[$i]['description']) . "")))->writeUInt32LE($this->_markers[$i]['sendTime'])->writeUInt32LE($this->_markers[$i]['flags'])->writeUInt32LE($descriptionLength)->writeString16($description);
     }
     $this->setSize(24 + 24 + strlen($name) + $markersWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_reserved1)->writeUInt32LE($markersCount)->writeUInt16LE($this->_reserved2)->writeUInt16LE(strlen($name))->writeString16($name)->write($markersWriter->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     $title = iconv($this->getOption('encoding'), 'utf-16le', $this->_title ? $this->_title . "" : '');
     $author = iconv($this->getOption('encoding'), 'utf-16le', $this->_author ? $this->_author . "" : '');
     $copyright = iconv($this->getOption('encoding'), 'utf-16le', $this->_copyright ? $this->_copyright . "" : '');
     $description = iconv($this->getOption('encoding'), 'utf-16le', $this->_description ? $this->_description . "" : '');
     $rating = iconv($this->getOption('encoding'), 'utf-16le', $this->_rating ? $this->_rating . "" : '');
     require_once 'Zend/Io/StringWriter.php';
     $buffer = new Zend_Io_StringWriter();
     $buffer->writeUInt16LE(strlen($title))->writeUInt16LE(strlen($author))->writeUInt16LE(strlen($copyright))->writeUInt16LE(strlen($description))->writeUInt16LE(strlen($rating))->writeString16($title)->writeString16($author)->writeString16($copyright)->writeString16($description)->writeString16($rating);
     $this->setSize(24 + $buffer->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->write($buffer->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $streamNameCount = count($this->_streamNames);
     $streamNameWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $streamNameCount; $i++) {
         $streamNameWriter->writeUInt16LE($this->_streamNames['languageIndex'])->writeUInt16LE(strlen($streamName = iconv($this->getOption('encoding'), 'utf-16le', $this->_streamNames['streamName']) . ""))->writeString16($streamName);
     }
     $payloadExtensionSystemCount = count($this->_payloadExtensionSystems);
     $payloadExtensionSystemWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $payloadExtensionSystemCount; $i++) {
         $payloadExtensionSystemWriter->writeGuid($this->_streamNames['extensionSystemId'])->writeUInt16LE($this->_streamNames['extensionDataSize'])->writeUInt16LE(strlen($extensionSystemInfo = iconv($this->getOption('encoding'), 'utf-16le', $this->_streamNames['extensionSystemInfo']) . ""))->writeString16($extensionSystemInfo);
     }
     $this->setSize(24 + 64 + $streamNameWriter->getSize() + $payloadExtensionSystemWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeInt64LE($this->_startTime)->writeInt64LE($this->_endTime)->writeUInt32LE($this->_dataBitrate)->writeUInt32LE($this->_bufferSize)->writeUInt32LE($this->_initialBufferFullness)->writeUInt32LE($this->_alternateDataBitrate)->writeUInt32LE($this->_alternateBufferSize)->writeUInt32LE($this->_alternateInitialBufferFullness)->writeUInt32LE($this->_maximumObjectSize)->writeUInt32LE($this->_flags)->writeUInt16LE($this->_streamNumber)->writeUInt16LE($this->_streamLanguageIndex)->writeInt64LE($this->_averageTimePerFrame)->writeUInt16LE($streamNameCount)->writeUInt16LE($payloadExtensionSystemCount)->write($streamNameWriter->toString())->write($payloadExtensionSystemWriter->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $buffer = new Zend_Io_StringWriter();
     $buffer->writeUInt32LE($this->_bannerImageType)->writeUInt32LE(count($this->_bannerImageData))->write($this->_bannerImageData)->writeUInt32LE(count($this->_bannerImageUrl))->write($this->_bannerImageUrl)->writeUInt32LE(count($this->_copyrightUrl))->write($this->_copyrightUrl);
     $this->setSize(24 + $buffer->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->write($buffer->toString());
 }
 /**
  * Writes the object data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 public function write($writer)
 {
     require_once 'Zend/Io/StringWriter.php';
     $recordCount = count($this->_records);
     $recordWriter = new Zend_Io_StringWriter();
     for ($i = 0; $i < $recordCount; $i++) {
         $recordWriter->writeUInt16LE($streamNumbersCount = count($this->_records[$i]));
         for ($j = 0; $j < $streamNumbersCount; $j++) {
             $recordWriter->writeUInt16LE($this->_records[$i][$j]['streamNumbers']);
         }
     }
     $this->setSize(24 + $recordWriter->getSize());
     $writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_exclusionType)->writeUInt16LE($recordCount)->write($recordWriter->toString());
 }