public static String getFileSizeString(long bytes) {        
        bytes = bytes / 1024;
        Double d = (double)bytes;
        if (bytes < 1024) {
            return bytes + " KiB";
        } else {
            bytes = bytes / 1024;
            if (bytes < 1024) {
                return bytes + " MiB";
            } else {
                bytes = bytes / 1024;
                if (bytes < 1024) {
                    return bytes + " GiB";
                } else {
                    bytes = bytes / 1024;            
                    return bytes + " TiB";
                }                                        
            }
        }
    }