Java examples for java.lang:long
bytes To Mega bytes
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { long bytes = 2; System.out.println(bytesToMegabytes(bytes)); }/*from w ww . j av a 2 s . c o m*/ private static long bytesToMegabytes(long bytes) { long MEGABYTE = 1024L * 1024L; return bytes / MEGABYTE; } }