read($len); $data = ''; $got = 0; while (($got = strlen($data)) < $len) { $data .= $this->read($len - $got); } return $data; } /** * Writes the given data out. * * @param string $buf The data to write * @throws TTransportException if writing fails */ public abstract function write($buf); /** * Flushes any pending data out of a buffer * * @throws TTransportException if a writing error occurs */ public function flush() {} } ?>