/** * Writes the frame raw data without the header. * * @param HausDesign_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)->writeString8($this->_contact, 1)->writeUInt8($this->_delivery); switch ($this->_encoding) { case self::UTF16LE: $writer->writeString16($this->_seller, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1)->writeString16($this->_description, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1); break; case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: $writer->writeString16($this->_seller, null, 1)->writeString16($this->_description, null, 1); break; default: $writer->writeString8($this->_seller, 1)->writeString8($this->_description, 1); break; } if ($this->_mimeType) { $writer->writeString8($this->_mimeType, 1)->write($this->_imageData); } }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_encoding)->write($this->_language); switch ($this->_encoding) { case self::UTF16LE: $writer->writeString16($this->_description, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1)->writeString16($this->_text, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER); break; case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: $writer->writeString16($this->_description, null, 1)->writeString16($this->_text); break; default: $writer->writeString8($this->_description, 1)->writeString8($this->_text); break; } }
/** * Writes the frame raw data without the header. * * @param HausDesign_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); } }
/** * Writes the header/footer data without the identifier. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ public function write($writer) { $writer->writeUInt8(floor($this->_version))->writeUInt8(($this->_version - floor($this->_version)) * 10)->writeUInt8($this->_flags)->writeUInt32BE($this->_encodeSynchsafe32($this->_size)); }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_encoding); foreach ($this->_people as $entry) { foreach ($entry as $key => $val) { switch ($this->_encoding) { case self::UTF16LE: $writer->writeString16($key, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1)->writeString16($val, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1); break; case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: $writer->writeString16($key, null, 1)->writeString16($val, null, 1); break; default: $writer->writeString8($key, 1)->writeString8($val, 1); break; } } } }
/** * Writes the frame raw data without the header. * * @param HausDesign_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($text, HausDesign_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; } }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_group)->write($this->_signature); }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_encoding)->write($this->_language)->writeUInt8($this->_format)->writeUInt8($this->_type); switch ($this->_encoding) { case self::UTF16LE: $writer->writeString16($this->_description, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1); break; case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: $writer->writeString16($this->_description, null, 1); break; default: $writer->writeString8($this->_description, 1); break; } foreach ($this->_events as $timestamp => $syllable) { switch ($this->_encoding) { case self::UTF16LE: $writer->writeString16($syllable, HausDesign_Io_Writer::LITTLE_ENDIAN_ORDER, 1); break; case self::UTF16: // break intentionally omitted // break intentionally omitted case self::UTF16BE: $writer->writeString16($syllable, null, 1); break; default: $writer->writeString8($syllable, 1); break; } $writer->writeUInt32BE($timestamp); } }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_format)->writeUInt32BE($this->_position); }
/** * Writes the frame raw data without the header. * * @param HausDesign_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { $writer->writeUInt8($this->_format); foreach ($this->_events as $timestamp => $tempo) { if ($tempo >= 0xff) { $writer->writeUInt8(0xff)->writeUInt8($tempo - 0xff); } else { $writer->writeUInt8($tempo); } $writer->writeUInt32BE($timestamp); } }
/** * Writes the frame raw data without the header. * * @param HausDesign_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, HausDesign_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; } }