public static String getHumanSize(Long size) {

        if (size == null) {
            return "";
        }

        String s = "";
        double num = 0;
        if (size < 1024) {
            num = size;

        } else if (size < (1024 * 1024)) {
            num = (double) size / 1024;
            s = "Kb";

        } else if (size < (1024 * 1024 * 1024)) {
            num = (double) size / (1024 * 1024);
            s = "Mb";

        } else {
            num = (double) size / (1024 * 1024 * 1024);
            s = "Gb";
        }

        DecimalFormat oneDec = new DecimalFormat("0.0");

        return oneDec.format(num) + " " + s;
    }