/** * {@inheritdoc} */ public function write(StreamInterface $stream, DataSet $result) { $dataSize = 2; $bytes = $result->getValue($this->name); for ($i = 0; $i < $dataSize; $i++) { $unsignedByte = $bytes >> ($dataSize - (1 + $i)) * 8 & 0xff; $stream->write(pack('C', intval($unsignedByte) & 0xff)); } }
/** * {@inheritdoc} */ public function write(StreamInterface $stream, DataSet $result) { $bytes = substr($result->getValue($this->getName()), 0, $this->size->get($result)); $stream->write($bytes); }
/** * {@inheritdoc} */ public function write(StreamInterface $stream, DataSet $result) { //Writing floats currently untested $bytes = $result->getValue($this->name); $stream->write(pack('f', intval($bytes))); }
/** * Write the value for this field, then the delimiter at the end. * * {@inheritdoc} */ public function write(StreamInterface $stream, DataSet $result) { $stream->write($result->getValue($this->getName())); $stream->write($this->delimiter->get($result)); }