public class TransferUtils
extends java.lang.Object
Constructor and Description |
---|
TransferUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
calculateEstimate(long currentsize,
long totalsize,
long timestart,
long timenow)
Calculate the estimated time of arrival
|
static java.lang.String |
calculateSpeed(long bytediff,
long timediff)
Calculates the speed when given a timedifference and bytedifference
|
static double |
calculateSpeedLong(long bytediff,
long timediff)
Calculates the speed and returns a long in kB/s
|
static java.lang.String |
convertSecondstoHHMMSS(int second)
Converts given Seconds to HH:MM:SS
|
static java.lang.String |
getAppropriateByteWithSuffix(long bytes)
Converts a given Byte into KB or MB or GB if applicable
|
public static java.lang.String calculateSpeed(long bytediff, long timediff)
bytediff
- in bytestimediff
- in millisecondspublic static double calculateSpeedLong(long bytediff, long timediff)
bytediff
- timediff
- public static java.lang.String calculateEstimate(long currentsize, long totalsize, long timestart, long timenow)
currentsize
- in bytetotalsize
- in bytetimestart
- in millisecondstimenow
- in millisecondspublic static java.lang.String convertSecondstoHHMMSS(int second)
second
- in secondspublic static java.lang.String getAppropriateByteWithSuffix(long bytes)
bytes
-