当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Io_Writer::writeInt64BE方法代码示例

本文整理汇总了PHP中Zend_Io_Writer::writeInt64BE方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Io_Writer::writeInt64BE方法的具体用法?PHP Zend_Io_Writer::writeInt64BE怎么用?PHP Zend_Io_Writer::writeInt64BE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Io_Writer的用法示例。


在下文中一共展示了Zend_Io_Writer::writeInt64BE方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeMessageData

 /**
  * Writes a data-record to the file.
  * @param mixed[] $msg_def
  * @param mixed[] $message_data
  * @return \Fit\Writer
  */
 protected function writeMessageData($msg_def, $message_data)
 {
     $local_msg_type = $this->getLocalMsgType($msg_def['global_msg_number']);
     $this->writeRecordHeaderByte($local_msg_type, false);
     //en nu de velddata wegschrijven
     foreach ($msg_def['fields'] as $field_def) {
         if (isset($message_data[$field_def[\Fit\Field::NAME]])) {
             $val = $message_data[$field_def[\Fit\Field::NAME]];
         } else {
             $val = null;
         }
         if (is_numeric($val) && $field_def[\Fit\Field::FACTOR] > 0) {
             $val /= $field_def[\Fit\Field::FACTOR];
         }
         $big_endian = $msg_def['architecture'] === 1;
         switch ($field_def[\Fit\Field::TYPE_NUMBER]) {
             case \Fit\Core::STRING:
                 $this->writer->writeString8((string) $val, $field_def[\Fit\Field::SIZE]);
                 break;
             case \Fit\Core::SINT8:
                 $this->writer->writeInt8($val);
                 break;
             case \Fit\Core::ENUM:
             case \Fit\Core::UINT8Z:
             case \Fit\Core::UINT8:
                 $this->writer->writeUInt8($val);
                 break;
             case \Fit\Core::SINT16:
                 $big_endian ? $this->writer->writeInt16BE($val) : $this->writer->writeInt16LE($val);
                 break;
             case \Fit\Core::UINT16Z:
             case \Fit\Core::UINT16:
                 $big_endian ? $this->writer->writeUInt16BE($val) : $this->writer->writeUInt16LE($val);
                 break;
             case \Fit\Core::SINT32:
                 $big_endian ? $this->writer->writeInt32BE($val) : $this->writer->writeInt32LE($val);
                 break;
             case \Fit\Core::UINT32Z:
             case \Fit\Core::UINT32:
                 $big_endian ? $this->writer->writeUInt32BE($val) : $this->writer->writeUInt32LE($val);
                 break;
             case \Fit\Core::FLOAT32:
                 $big_endian ? $this->writer->writeFloatBE($val) : $this->writer->writeFloatLE($val);
                 break;
             case \Fit\Core::FLOAT64:
                 $big_endian ? $this->writer->writeInt64BE($val) : $this->writer->writeInt64LE($val);
                 break;
             case \Fit\Core::BYTE:
             default:
                 $this->writer->write($val, $field_def[\Fit\Field::SIZE]);
         }
     }
     return $this;
 }
开发者ID:alexmcroberts,项目名称:fit-php,代码行数:60,代码来源:Writer.php

示例2: _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

示例3: _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

示例4: _writeData

 /**
  * Writes the box data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     $writer->writeUInt32BE($entryCount = count($this->_chunkOffsetTable));
     for ($i = 1; $i <= $entryCount; $i++) {
         $writer->writeInt64BE($this->_chunkOffsetTable[$i]);
     }
 }
开发者ID:lokamaya,项目名称:zend-mp3,代码行数:13,代码来源:Co64.php

示例5: _writeData

 /**
  * Writes the box header. Subclasses should overwrite this method and call
  * the parent method first and then write the box related data.
  *
  * @param Zend_Io_Writer $writer The writer object.
  * @return void
  */
 protected function _writeData($writer)
 {
     if (get_class($this) == "Zend_Media_Iso14496_Box") {
         require_once 'Zend/Media/Iso14496/Exception.php';
         throw new Zend_Media_Iso14496_Exception('Unknown box \'' . $this->getType() . '\' cannot be written.');
     }
     $this->_size = $this->getHeapSize();
     if ($this->_size > 4294967295.0) {
         $writer->writeUInt32BE(1);
     } else {
         $writer->writeUInt32BE($this->_size);
     }
     if (strlen($this->_type) > 4) {
         $writer->write('uuid');
     } else {
         $writer->write($this->_type);
     }
     if ($this->_size > 4294967295.0) {
         $writer->writeInt64BE($this->_size);
     }
     if (strlen($this->_type) > 4) {
         $writer->writeGuid($this->_type);
     }
 }
开发者ID:andreiamfg,项目名称:MobileWebHybrid,代码行数:31,代码来源:Box.php


注:本文中的Zend_Io_Writer::writeInt64BE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。