protected function read($length) {
		if ($this->length < $length) {
			throw new \Exception('Reading while at end of stream');
		}
		$output = substr($this->data, 0, $length);
		$this->data = substr($this->data, $length);
		$this->length -= $length;
		return $output;
	}
protected function read($length) {
		if ($this->length < $length) {
			throw new \Exception('Reading while at end of stream');
		}
		$output = substr($this->data, 0, $length);
		$this->data = substr($this->data, $length);
		$this->length -= $length;
		return $output;
	}
protected function read ( $ length ) { if ( $ this -> length < $ length ) { throw new \ Exception ( 'Reading while at end of stream' ) ; } $ output = substr ( $ this -> data , 0 , $ length ) ; $ this -> data = substr ( $ this -> data , $ length ) ; $ this -> length -= $ length ; return $ output ; }
Read data from stream.

@param int $length
@throws \Exception
@return string
Read data from stream .