read($len); $data = ''; $got = 0; while (($got = TStringFuncFactory::create()->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 */ abstract public function write($buf); /** * Flushes any pending data out of a buffer * * @throws TTransportException if a writing error occurs */ public function flush() { } }