private long convertToBytes(int megaBytes){
  long bytes=megaBytes;
  bytes=bytes * 1024 * 1024;
  return bytes;
}

private long convertToBytes ( int megaBytes ) { long bytes = megaBytes ; bytes = bytes * 1024 * 1024 ; return bytes ; }
takes an int which is supposed to be in megabytes and converts it to a long . this conversion takes into account that multiplication can lead to integer . max_value being exceeded
