code: def find_newline(self, size=-1):
      
      if size < 0:
        return self._buffer.find('\n', self._offset)
      return self._buffer.find('\n', self._offset, self._offset + size)
docs: Search for newline char in buffer starting from current offset.
  
      Args:
        size: number of bytes to search. -1 means all.
  
      Returns:
        offset of newline char in buffer. -1 if doesn't exist.