All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.commons.BinarySize Maven / Gradle / Ivy

There is a newer version: 12.0.2
Show newest version
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