Ejemplo n.º 1
0
 /**
  * Compile the entire MIME document into a string
  * The returned string may be used in other documents if needed.
  * @return Swift_Cache_OutputStream
  */
 public function build()
 {
     $this->preBuild();
     $data = $this->buildData();
     $joint_os = new Swift_Cache_JointOutputStream();
     $this->cache->clear("headers");
     $this->cache->write("headers", $this->headers->build());
     $joint_os->addStream($this->cache->getOutputStream("headers"));
     $this->cache->clear("dbl_le");
     $this->cache->write("dbl_le", str_repeat($this->LE, 2));
     $joint_os->addStream($this->cache->getOutputStream("dbl_le"));
     $joint_os->addStream($data);
     return $joint_os;
     //return $this->headers->build() . str_repeat($this->LE, 2) . $data;
 }
Ejemplo n.º 2
0
 /**
  * Read bytes from the cache and seek through the buffer
  * Returns false if EOF is reached
  * @param int The number of bytes to read (could be ignored)
  * @return string The read bytes
  */
 public function read($size = null)
 {
     return $this->cache->read($this->key, $size);
 }
Ejemplo n.º 3
0
 /**
  * Compile the entire MIME document into a string
  * The returned string may be used in other documents if needed.
  * @return Swift_Cache_OutputStream
  */
 function &build()
 {
     $this->preBuild();
     $data =& $this->buildData();
     $i = array();
     $joint_os =& new Swift_Cache_JointOutputStream($i);
     $this->cache->clear("headers");
     $this->cache->write("headers", $this->headers->build());
     $headers =& $this->cache->getOutputStream("headers");
     $joint_os->addStream($headers);
     $this->cache->clear("dbl_le");
     $this->cache->write("dbl_le", str_repeat($this->LE, 2));
     $dbl_le =& $this->cache->getOutputStream("dbl_le");
     $joint_os->addStream($dbl_le);
     $joint_os->addStream($data);
     return $joint_os;
 }