code: def readline(self, size=-1):
          
          remainder = int(self.length) - self.__position
          if size < 0 or size > remainder:
              size = remainder
  
          if size == 0:
              return EMPTY
  
          received = 0
          data = StringIO()
          while received < size:
              chunk_data = self.readchunk()
              pos = chunk_data.find(NEWLN, 0, size)
              if pos != -1:
                  size = received + pos + 1
  
              received += len(chunk_data)
              data.write(chunk_data)
              if pos != -1:
                  break
  
          self.__position -= received - size
  
          # Return 'size' bytes and store the rest.
          data.seek(size)
          self.__buffer = data.read()
          data.seek(0)
          return data.read(size)
docs: Read one line or up to `size` bytes from the file.
  
          :Parameters:
           - `size` (optional): the maximum number of bytes to read