src/PelDataWindow.php
public function getBytes($start = null, $size = null)
    {
        if (is_int($start)) {
            if ($start < 0) {
                $start += $this->size;
            }

            $this->validateOffset($start);
        } else {
            $start = 0;
        }

        if (is_int($size)) {
            if ($size <= 0) {
                $size += $this->size - $start;
            }

            $this->validateOffset($start + $size);
        } else {
            $size = $this->size - $start;
        }

        return substr($this->data, $this->start + $start, $size);
    }
public function getBytes($start = null, $size = null)
    {
        if (is_int($start)) {
            if ($start < 0) {
                $start += $this->size;
            }

            $this->validateOffset($start);
        } else {
            $start = 0;
        }

        if (is_int($size)) {
            if ($size <= 0) {
                $size += $this->size - $start;
            }

            $this->validateOffset($start + $size);
        } else {
            $size = $this->size - $start;
        }

        return substr($this->data, $this->start + $start, $size);
    }
public function getBytes ( $ start = null , $ size = null ) { if ( is_int ( $ start ) ) { if ( $ start < 0 ) { $ start += $ this -> size ; } $ this -> validateOffset ( $ start ) ; } else { $ start = 0 ; } if ( is_int ( $ size ) ) { if ( $ size <= 0 ) { $ size += $ this -> size - $ start ; } $ this -> validateOffset ( $ start + $ size ) ; } else { $ size = $ this -> size - $ start ; } return substr ( $ this -> data , $ this -> start + $ start , $ size ) ; }
Return some or all bytes visible in the window.

This method works just like the standard {@link substr()}
function in PHP with the exception that it works within the
window of accessible bytes and does strict range checking.

@param integer|NULL $start
the offset to the first byte returned. If a negative
number is given, then the counting will be from the end of the
window. Invalid offsets will result in a {@link
PelDataWindowOffsetException} being thrown.

@param integer|NUL $size
the size of the sub-window. If a negative number is
given, then that many bytes will be omitted from the result.

@return string a subset of the bytes in the window. This will
always return no more than {@link getSize()} bytes.
@throws PelDataWindowOffsetException
Return some or all bytes visible in the window .