public function getContents($maxLength = -1)
{
if ($this->reachedEof) {
return $this->cache;
}
$contents = stream_get_contents($this->resource, $maxLength);
$this->cache .= $contents;
if ($maxLength === -1 || $this->eof()) {
$this->reachedEof = true;
}
return $contents;
}