本文整理汇总了PHP中Zend_Io_Writer类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Io_Writer类的具体用法?PHP Zend_Io_Writer怎么用?PHP Zend_Io_Writer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Io_Writer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
if ($this->getSize() == 0) {
$this->setSize(24);
}
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->write(str_pad('', $this->getSize() - 24, ""));
}
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:13,代码来源:Padding.php
示例2: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$objectsWriter = new Zend_Io_StringWriter();
foreach ($this->getObjects() as $objects) {
foreach ($objects as $object) {
$object->write($objectsWriter);
}
}
$this->setSize(24 + 22 + $objectsWriter->getSize());
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_reserved1)->writeUInt16LE($this->_reserved2)->writeUInt32LE($objectsWriter->getSize())->write($objectsWriter->toString());
}
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:17,代码来源:HeaderExtension.php
示例3: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$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());
}
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:16,代码来源:LanguageList.php
示例4: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeString8($this->_owner, 1)->writeInt8($this->_rating);
if ($this->_counter > 0xffffffff) {
$writer->writeInt64BE($this->_counter);
} else {
if ($this->_counter > 0) {
$writer->writeUInt32BE($this->_counter);
}
}
}
开发者ID:adam-fonseca,项目名称:RuneUI,代码行数:17,代码来源:Popm.php
示例5: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->write($this->_data);
}
开发者ID:jreinert,项目名称:RuneUI,代码行数:10,代码来源:Unknown.php
示例6: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
require_once 'Zend/Io/StringWriter.php';
$objectsWriter = new Zend_Io_StringWriter();
foreach ($this->getObjects() as $objects) {
foreach ($objects as $object) {
$object->write($objectsWriter);
}
}
$this->setSize(24 + 6 + $objectsWriter->getSize());
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt32LE($this->getObjectCount())->writeInt8($this->_reserved1)->writeInt8($this->_reserved2)->write($objectsWriter->toString());
}
开发者ID:jreinert,项目名称:RuneUI,代码行数:18,代码来源:Header.php
示例7: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeUInt8($this->_encoding);
switch ($this->_encoding) {
case self::UTF16LE:
$count = count($this->_text);
for ($i = 0; $i < $count; $i++) {
$writer->writeString16($this->_text, Zend_Io_Writer::LITTLE_ENDIAN_ORDER, $i == $count ? null : 1);
}
break;
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
$writer->write(implode("", $this->_text));
break;
default:
$writer->write(implode("", $this->_text));
break;
}
}
开发者ID:google-code-backups,项目名称:php-reader,代码行数:27,代码来源:TextFrame.php
示例8: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeUInt8($this->_format);
foreach ($this->_events as $timestamp => $type) {
$writer->writeUInt8($type)->writeUInt32BE($timestamp);
}
}
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:13,代码来源:Etco.php
示例9: write
/**
* 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());
}
开发者ID:adam-fonseca,项目名称:RuneUI,代码行数:54,代码来源:StreamProperties.php
示例10: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$this->setSize(24 + 8 + strlen($this->_data));
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt32LE($this->_type)->writeUInt32LE(strlen($this->_data))->write($this->_data);
}
开发者ID:jreinert,项目名称:RuneUI,代码行数:11,代码来源:DigitalSignature.php
示例11: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
if ($this->_counter > 4294967295) {
$writer->writeInt64BE($this->_counter);
// UInt64
} else {
$writer->writeUInt32BE($this->_counter);
}
}
开发者ID:adam-fonseca,项目名称:RuneUI,代码行数:15,代码来源:Pcnt.php
示例12: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeInt8($this->_interpolation)->writeString8($this->_device, 1);
foreach ($this->_adjustments as $frequency => $adjustment) {
$writer->writeUInt16BE($frequency * 2)->writeInt16BE($adjustment * 512);
}
}
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:13,代码来源:Equ2.php
示例13: write
/**
* 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());
}
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:28,代码来源:ScriptCommand.php
示例14: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeUInt8($this->_group)->write($this->_signature);
}
开发者ID:hjoelr,项目名称:com_mediasyndicator,代码行数:10,代码来源:Sign.php
示例15: write
/**
* Writes the header data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
/* ID3v2.3.0 ExtendedHeader */
if ($this->getOption('version', 4) < 4) {
$writer->writeUInt32BE($this->_size)->writeUInt16BE($this->hasFlag(self::CRC32) ? 0x8000 : 0)->writeUInt32BE($this->_padding);
if ($this->hasFlag(self::CRC32)) {
$writer->writeUInt32BE($this->_crc);
}
} else {
$writer->writeUInt32BE($this->_encodeSynchsafe32($this->_size))->writeInt8(1)->writeInt8($this->_flags);
if ($this->hasFlag(self::UPDATE)) {
$writer->write("");
}
if ($this->hasFlag(self::CRC32)) {
$writer->writeInt8(5)->writeInt8($this->_crc & 4026531840.0 >> 28 & 0xf)->writeUInt32BE($this->_encodeSynchsafe32($this->_crc));
}
if ($this->hasFlag(self::RESTRICTED)) {
$writer->writeInt8(1)->writeInt8($this->_restrictions);
}
}
}
开发者ID:halbo5,项目名称:com_muzeetop_j16,代码行数:27,代码来源:ExtendedHeader.php
示例16: write
/**
* 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());
}
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:20,代码来源:AdvancedContentEncryption.php
示例17: write
/**
* 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());
}
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:52,代码来源:MetadataLibrary.php
示例18: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeUInt8($this->_encoding)->write($this->_currency)->writeString8($this->_price, 1)->write($this->_date);
switch ($this->_encoding) {
case self::UTF16LE:
$writer->writeString16($this->_seller, Zend_Io_Writer::LITTLE_ENDIAN_ORDER);
break;
case self::UTF16:
// break intentionally omitted
// break intentionally omitted
case self::UTF16BE:
$writer->writeString16($this->_seller);
break;
default:
$writer->writeString8($this->_seller);
break;
}
}
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:24,代码来源:Owne.php
示例19: _writeData
/**
* Writes the frame raw data without the header.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
protected function _writeData($writer)
{
$writer->writeString8($this->_owner, 1)->write($this->_fileIdentifier);
}
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:10,代码来源:Ufid.php
示例20: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$this->setSize(24 + 2);
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt8($this->_profile)->writeUInt8($this->_mode);
}
开发者ID:google-code-backups,项目名称:php-reader,代码行数:11,代码来源:Compatibility.php
注:本文中的Zend_Io_Writer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论