(self, size=-1)
return data.read(size)
Read one line or up to `size` bytes from the file.

        :Parameters:
         - `size` (optional): the maximum number of bytes to read
Read one line or up to `size` bytes from the file.
Read one line or up to size bytes from the file .
def readline(self, size=-1):
        """Read one line or up to `size` bytes from the file.

        :Parameters:
         - `size` (optional): the maximum number of bytes to read
        """
        if size == 0:
            return b''

        remainder = int(self.length) - self.__position
        if size < 0 or size > remainder:
            size = remainder

        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)
def readline ( self , size = - 1 ) : if size == 0 : return b'' remainder = int ( self . length ) - self . __position if size < 0 or size > remainder : size = remainder 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 )