public function readByte($position = null)
    {
        if ($position !== null) {
            $position = (int) $position;
            // check if needed bytes are available in the current buffer
            if (!($position >= $this->position && $position < $this->position + $this->bufferLength)) {
                $this->reset($position);
                $offset = $this->offset;
            } else {
                $offset = $position - $this->position;
            }
        } else {
            $offset = $this->offset;
        }

        if ($offset >= $this->bufferLength &&
            ((!$this->increaseLength()) || $offset >= $this->bufferLength)
        ) {
            return false;
        }

        $this->offset = $offset + 1;
        return $this->buffer[$offset];
    }
public function readByte($position = null)
    {
        if ($position !== null) {
            $position = (int) $position;
            // check if needed bytes are available in the current buffer
            if (!($position >= $this->position && $position < $this->position + $this->bufferLength)) {
                $this->reset($position);
                $offset = $this->offset;
            } else {
                $offset = $position - $this->position;
            }
        } else {
            $offset = $this->offset;
        }

        if ($offset >= $this->bufferLength &&
            ((!$this->increaseLength()) || $offset >= $this->bufferLength)
        ) {
            return false;
        }

        $this->offset = $offset + 1;
        return $this->buffer[$offset];
    }
public function readByte ( $ position = null ) { if ( $ position !== null ) { $ position = ( int ) $ position ; // check if needed bytes are available in the current buffer if ( ! ( $ position >= $ this -> position && $ position < $ this -> position + $ this -> bufferLength ) ) { $ this -> reset ( $ position ) ; $ offset = $ this -> offset ; } else { $ offset = $ position - $ this -> position ; } } else { $ offset = $ this -> offset ; } if ( $ offset >= $ this -> bufferLength && ( ( ! $ this -> increaseLength ( ) ) || $ offset >= $ this -> bufferLength ) ) { return false ; } $ this -> offset = $ offset + 1 ; return $ this -> buffer [ $ offset ] ; }
Returns a byte at a specific position, and set the offset to the next byte position.

If the position is invalid the method will return false.

If the $position parameter is set to null the value of $this->offset will be used.

@param int|null $position
@return string|bool
Returns a byte at a specific position and set the offset to the next byte position .