public static Long translateSizeToBytes(Long size,String unit){
  long multiplier=1;
  String sizeSubstr;
  if (unit.equals(SIZE_TB)) {
    multiplier=1024 * 1024 * 1024* 1024L;
  }
 else   if (unit.equals(SIZE_GB)) {
    multiplier=1024 * 1024 * 1024L;
  }
 else   if (unit.equals(SIZE_MB)) {
    multiplier=1024 * 1024L;
  }
 else   if (unit.equals(SIZE_KB)) {
    multiplier=1024L;
  }
  return size * multiplier;
}

public static Long translateSizeToBytes ( Long size , String unit ) { long multiplier = 1 ; String sizeSubstr ; if ( unit . equals ( SIZE_TB ) ) { multiplier = 1024 * 1024 * 1024 * 1024L ; } else if ( unit . equals ( SIZE_GB ) ) { multiplier = 1024 * 1024 * 1024L ; } else if ( unit . equals ( SIZE_MB ) ) { multiplier = 1024 * 1024L ; } else if ( unit . equals ( SIZE_KB ) ) { multiplier = 1024L ; } return size * multiplier ; }
given size in tb , gb , mb , kb return converted value as bytes
