本文整理汇总了PHP中Zend_Io_Writer::writeUInt16LE方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Io_Writer::writeUInt16LE方法的具体用法?PHP Zend_Io_Writer::writeUInt16LE怎么用?PHP Zend_Io_Writer::writeUInt16LE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Io_Writer
的用法示例。
在下文中一共展示了Zend_Io_Writer::writeUInt16LE方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writeMessageDefinition
/**
* Writes a definition record to file, when necessary (not already written).
* @param mixed[] $msg_def The definition of the message.
* @return \Fit\Writer
*/
protected function writeMessageDefinition($msg_def)
{
$local_msg_type = $this->getLocalMsgType($msg_def['global_msg_number'], true);
if ($local_msg_type !== false) {
$this->writeRecordHeaderByte($local_msg_type, true);
//write definition record fields
$this->writer->writeUInt8(0);
//reserved
//architecture
$this->writer->writeUInt8($msg_def['architecture']);
//Architecture Type 0: Definition and Data Messages are Little Endian 1: Definition and Data Message are Big Endian
$big_endian = $msg_def['architecture'] === 1;
//global_msg_number
if ($big_endian) {
$this->writer->writeUInt16BE($msg_def['global_msg_number']);
//0:65535 – Unique to each message *Endianness of this 2 Byte value is defined in the Architecture byte
} else {
$this->writer->writeUInt16LE($msg_def['global_msg_number']);
//0:65535 – Unique to each message *Endianness of this 2 Byte value is defined in the Architecture byte
}
//no_of_fields
$this->writer->writeUInt8(count($msg_def['fields']));
//Number of fields in the Data Message
foreach ($msg_def['fields'] as $field_def) {
$this->writer->writeUInt8($field_def[\Fit\Field::DEF_NUMBER]);
$this->writer->writeUInt8($field_def[\Fit\Field::SIZE]);
$this->writer->writeUInt8(self::bartoint(array_merge(array_slice(self::inttobar($field_def[\Fit\Field::TYPE_NUMBER]), 0, 5), array(false, false, self::$base_types[$field_def[\Fit\Field::TYPE_NUMBER]]['endian_ability']))));
}
}
return $this;
}
示例2: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$streamNumbersCount = count($this->_streamNumber);
$this->setSize(24 + 28 + $streamNumbersCount * 2);
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_sharingType)->writeUInt32LE($this->_dataBitrate)->writeUInt32LE($this->_bufferSize)->writeUInt16LE($streamNumbersCount);
for ($i = 0; $i < $streamNumbersCount; $i++) {
$writer->writeUInt16LE($this->_streamNumbers[$i]);
}
}
示例3: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$priorityRecordCount = count($this->_priorityRecords);
$this->setSize(24 + 2 + $priorityRecordCount * 4);
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($priorityRecordCount);
for ($i = 0; $i < $priorityRecordCount; $i++) {
$writer->writeUInt16LE($this->_priorityRecords[$i]['streamNumber'])->writeUInt16LE($this->_priorityRecords[$i]['flags']);
}
}
示例4: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$streamNumbersCount = count($this->_streamNumbers);
$this->setSize(24 + 18 + $streamNumbersCount * 2);
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeGuid($this->_exclusionType)->writeUInt16LE($streamNumbersCount);
for ($i = 0; $i < $streamNumbersCount; $i++) {
$writer->writeUInt16LE($this->_streamNumbers[$i]);
}
}
示例5: write
/**
* Writes the object data.
*
* @param Zend_Io_Writer $writer The writer object.
* @return void
*/
public function write($writer)
{
$bitrateRecordsCount = count($this->_bitrateRecords);
$this->setSize(24 + 2 + $bitrateRecordsCount * 6);
$writer->writeGuid($this->getIdentifier())->writeInt64LE($this->getSize())->writeUInt16LE($bitrateRecordsCount);
for ($i = 0; $i < $bitrateRecordsCount; $i++) {
$writer->writeUInt16LE($this->_bitrateRecords[$i]['flags'] << 5 | $this->_bitrateRecords[$i]['streamNumber'] & 0x1f)->writeUInt32LE($this->_bitrateRecords[$i]['averageBitrate']);
}
}