'Read chars from self._buffer.
Args:
size: number of chars to read. Read the entire buffer if negative.
Returns:
chars read in string.'

def __readBuffer(self, size):

    if (size < 0):
        size = (len(self._buffer) - self._buffer_pos)
    result = self._buffer[self._buffer_pos:(self._buffer_pos + size)]
    self._position += len(result)
    self._buffer_pos += len(result)
    return result
