Here you can find the source of bytesToMegabytes(long bytes)
private static long bytesToMegabytes(long bytes)
//package com.java2s; public class Main { private static final long MEGABYTE = 1024L * 1024L; private static long bytesToMegabytes(long bytes) { return bytes / MEGABYTE; }// w w w.j a va 2s . c o m }