@codeCoverageIgnore
Overrides AbstractEntityBodyDecorator::read
public function read($length) {
// Check if the current position is less than the total allowed bytes + original offset
$remaining = $this->offset + $this->limit - $this->body
->ftell();
if ($remaining > 0) {
// Only return the amount of requested data, ensuring that the byte limit is not exceeded
return $this->body
->read(min($remaining, $length));
}
else {
return false;
}
}