예제 #1
0
 /**
  * {@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));
     }
 }
예제 #2
0
 /**
  * Write $this->size NUL bytes to $stream.
  *
  * {@inheritdoc}
  */
 public function write(StreamInterface $stream, DataSet $result)
 {
     $stream->write(pack('x' . $this->size->get($result)));
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function write(StreamInterface $stream, DataSet $result)
 {
     $bytes = substr($result->getValue($this->getName()), 0, $this->size->get($result));
     $stream->write($bytes);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function write(StreamInterface $stream, DataSet $result)
 {
     //Writing floats currently untested
     $bytes = $result->getValue($this->name);
     $stream->write(pack('f', intval($bytes)));
 }
예제 #5
0
 /**
  * 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));
 }