net.dongliu.commons.BinarySize Maven / Gradle / Ivy
package net.dongliu.commons;
/**
* @author Liu Dong
*/
public class BinarySize {
public static long kilobyte(double quantity) {
return (long) (quantity * 1024);
}
public static long kilobyte(long quantity) {
return quantity * 1024;
}
public static long megabyte(double quantity) {
return (long) (quantity * 1024 * 1024);
}
public static long megabyte(long quantity) {
return quantity * 1024 * 1024;
}
public static long gigabyte(double quantity) {
return (long) (quantity * 1024 * 1024 * 1024);
}
public static long gigabyte(long quantity) {
return quantity * 1024 * 1024 * 1024;
}
public static long terabyte(double quantity) {
return (long) (quantity * 1024 * 1024 * 1024 * 1024);
}
public static long terabyte(long quantity) {
return quantity * 1024 * 1024 * 1024 * 1024;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy