/** * Gets the time to transfer a file (in MBytes) * according to a given transfer speed (in Mbits/sec). * * @param fileSize the size of the file to compute the transfer time (in MBytes) * @param speed the speed (in MBits/sec) to compute the time to transfer the file * @return the transfer time in seconds */ protected final double getTransferTime(final int fileSize, final double speed){ return Conversion.bytesToBits(fileSize)/speed; }
/** * Converts a value in bytes to Megabites (Mb) * @param bytes the value in bytes * @return the value in Megabites (Mb) */ public static double bytesToMegaBits(final double bytes){ return bytesToBits(bytesToMegaBytes(bytes)); }