/** This method test the sending of a single binary file. */
  public void testSendingBinaryFile() {
    if (iDoTest) {
      try {
        // First get a binary file to send.
        String file = TestCaseLM.getFullFilePath("testFile.jpg");

        FTPClient lFtpClient = new FTPClient(this.iServer, this.iUser, this.iPassword);
        lFtpClient.sendBinaryFile(file);

        // Now find the file on the server.
        File f = new File(iDestination + new File(file).getName());
        // See if it exists.
        Assert.assertTrue(f.exists());
        // Compare it byte by byte.
        BufferedInputStream biOriginal = new BufferedInputStream(new FileInputStream(file));
        BufferedInputStream biControl = new BufferedInputStream(new FileInputStream(f));

        int current = -1;
        while ((current = biOriginal.read()) != -1) {
          Assert.assertEquals(current, biControl.read());
        }
        // Now we should also get an 'EOF' byte from the destination file.
        Assert.assertTrue(biControl.read() == -1);

        // Close readers.
        biControl.close();
        biOriginal.close();

        // Delete the destination file.
        while (!f.delete()) {}
      } catch (IOException ioe) {
        logger.error(ioe.getMessage(), ioe);
        fail(
            "IOException thrown when attempting to send a single binary file: " + ioe.getMessage());
      }
    }
  }