def __check_read_size(self, read_length):
        index = self.__pos + read_length - 1
        if index < self.__start_pos or index >= self.__max_pos:
            raise IndexError(
                "Ran off end of buffer (position %i, limit %i, reading %i bytes"
                % (self.__pos, self.__max_pos, read_length))
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/json_lib/parser.py/ByteScanner.__check_read_size/original