Here you can find the source of bytesToGB(long bytes)
public static float bytesToGB(long bytes)
//package com.java2s; //License from project: Apache License public class Main { public static final long ONE_GB = 1073741824L; public static float bytesToGB(long bytes) { return (float) bytes / ONE_GB; }//w ww. j av a 2 s . c om }