#NEWLINE# def beginFileTransfer( self , file , consumer , transform = None ) : #NEWLINE# #INDENT# '\n        Begin transferring a file\n\n        @type file: Any file-like object\n        @param file: The file object to read data from\n\n        @type consumer: Any implementor of IConsumer\n        @param consumer: The object to write data to\n\n        @param transform: A callable taking one string argument and returning\n        the same.  All bytes read from the file are passed through this before\n        being written to the consumer.\n\n        @rtype: C{Deferred}\n        @return: A deferred whose callback will be invoked when the file has\n        been completely written to the consumer. The last byte written to the\n        consumer is passed to the callback.\n        ' #NEWLINE# self . file = file #NEWLINE# self . consumer = consumer #NEWLINE# self . transform = transform #NEWLINE# self . deferred = deferred = defer . Deferred ( ) #NEWLINE# self . consumer . registerProducer ( self , False ) #NEWLINE# return deferred