Requests a named file from a remote host, writes the file to an OutputStream, closes the connection, and returns the number of bytes read. A local UDP socket must first be created by {@link org.apache.commons.net.DatagramSocketClient#open open()} beforeinvoking this method. This method will not close the OutputStream containing the file; you must close it after the method invocation.
@param filename The name of the file to receive.
@param mode The TFTP mode of the transfer (one of the MODE constants).
@param output The OutputStream to which the file should be written.
@param host The remote host serving the file.
@param port The port number of the remote TFTP server.
@exception IOException If an I/O error occurs. The nature of theerror will be reported in the message.