public static Double translateSize(Long size,String to){
  if (size == null || size.longValue() == 0) {
    return 0.0;
  }
  long multiplier=1L;
  if (to.endsWith(SIZE_TB)) {
    multiplier=1024 * 1024 * 1024* 1024L;
  }
 else   if (to.endsWith(SIZE_GB)) {
    multiplier=1024 * 1024 * 1024L;
  }
 else   if (to.endsWith(SIZE_MB)) {
    multiplier=1024 * 1024L;
  }
 else   if (to.endsWith(SIZE_KB)) {
    multiplier=1024L;
  }
  return (double)size / (double)multiplier;
}

public static Double translateSize ( Long size , String to ) { if ( size == null || size . longValue ( ) == 0 ) { return 0.0 ; } long multiplier = 1L ; if ( to . endsWith ( SIZE_TB ) ) { multiplier = 1024 * 1024 * 1024 * 1024L ; } else if ( to . endsWith ( SIZE_GB ) ) { multiplier = 1024 * 1024 * 1024L ; } else if ( to . endsWith ( SIZE_MB ) ) { multiplier = 1024 * 1024L ; } else if ( to . endsWith ( SIZE_KB ) ) { multiplier = 1024L ; } return ( double ) size / ( double ) multiplier ; }
given size in bytes , return converted value as tb , gb , mb as specified in " to "
