Utility method to include the SI unit name.
@param value The value of a Long in String form.
@return Rounded value with appended SI units.  For example, 45.3MB, 62B, 27.2GB, etc.
188153
public String addUnits( String value ) {

		StringBuffer buff = new StringBuffer(100);
		
		long bytes = Long.parseLong(value);

		if( bytes < 1000000 ) {
			
			buff.append(value);
			buff.append("B");
			
		} else {
			
			int unit = 1000;
			int exp = (int) (Math.log(bytes) / Math.log(unit));
			String pre = "kMGTPE".charAt(exp-1)+"";
			String ov = String.format("%.1f%sB", bytes / Math.pow(unit, exp), pre);
			buff.append(ov);
			
		}

		return buff.toString();
		
	}
479850
public static long getLong(
    Object      value)
  {
    if (value == null)
    {
        return 0;
    }

    return Long.valueOf(value.toString()).longValue();
  }
1055841
public static long longFromBase64(String value) {
        int pos = 0;
        long longVal = base64Values[value.charAt(pos++)];
        int len = value.length();
        while (pos < len) {
            longVal <<= 6;
            longVal |= base64Values[value.charAt(pos++)];
        }
        return longVal;
    }
345813
function(value) {
  if (value && value._bsontype) {
    if (_.includes([ 'Decimal128', 'Long' ], value._bsontype)) {
      return value.toString();
    }
    if (_.includes([ 'Double', 'Int32' ], value._bsontype)) {
      return String(value.value);
    }
  }
  if (_.isString(value)) {
    return value;
  }
  return String(value);
}
172082
public static String toPaddedNumber(int value, int width) {
		StringBuilder s = new StringBuilder("00000000").append(Integer.toString(value));
		return s.substring(s.length() - width);
	}
357440
@VisibleForTesting
    protected static String createLabelText(
            final DistanceUnit scaleUnit, final double value, final DistanceUnit intervalUnit) {
        double scaledValue = scaleUnit.convertTo(value, intervalUnit);

        // assume that there is no interval smaller then 0.0001
        scaledValue = Math.round(scaledValue * 10000) / 10000;
        String decimals = Double.toString(scaledValue).split("\\.")[1];

        if (Double.valueOf(decimals) == 0) {
            return Long.toString(Math.round(scaledValue));
        } else {
            return Double.toString(scaledValue);
        }
    }
624634
public static int getBitSize(long value) {
		if (value > Integer.MAX_VALUE) {
			return 64 - Integer.numberOfLeadingZeros((int) (value >> 32));
		} else {
			return 32 - Integer.numberOfLeadingZeros((int) value);
		}
	}
703186
private BigInteger printExtendedAttributeDurationFormat(Object value)
   {
      BigInteger result = null;
      if (value instanceof Duration)
      {
         result = DatatypeConverter.printDurationTimeUnits(((Duration) value).getUnits(), false);
      }
      return (result);
   }
771268
protected long parseLong( String value ) {
        long factor = 1;
        if (value.endsWith("K")) {
            factor = KILO;
        } else if (value.endsWith("M")) {
            factor = MEGA;
        } else if (value.endsWith("G")) {
            factor = GIGA;
        }
        if (factor > 1) {
            value = value.substring(0, value.length() - 1);
        }
        return new BigInteger(value).longValue() * factor;
    }
259866
public void addUnsignedShort( int value ) {

        if ( 2 + length < capacity ) {
            DynamicByteBufferHelper.unsignedShortTo( buffer, length, value );
        } else {
            buffer = DynamicByteBufferHelper.grow( buffer, buffer.length * 2 + 2 );
            capacity = buffer.length;

            DynamicByteBufferHelper.unsignedShortTo( buffer, length, value );
        }

        length += 2;


    }
1162859
public static String compactDecimal(final Number value)
    {
        NumberFormat fmt = context.get().getCompactDecimalFormat();
        return fmt.format(value);
    }
363622
@Override
    public Byte convert(Object value) {
        if (value instanceof Number) {
            double d = ((Number)value).doubleValue();
            if (Double.isNaN(d) || Math.round(d)!=d) throw new IllegalArgumentException("Not a valid byte: " + value);
            long l = ((Number)value).longValue();
            if (l>=Byte.MIN_VALUE && l<=Byte.MAX_VALUE) return Byte.valueOf((byte)l);
            else throw new IllegalArgumentException("Value too large for byte: " + value);
        } else if (value instanceof String) {
            return Byte.parseByte((String)value);
        } else return null;
    }
485330
public static long doubleToSortableLong(double value)
    {
        long bits = Double.doubleToLongBits(value);
        return bits ^ (bits >> 63) & Long.MAX_VALUE;
    }
1070979
public static final Number parseExtendedAttributeCurrency(String value)
   {
      Number result;

      if (value == null)
      {
         result = null;
      }
      else
      {
         result = NumberHelper.getDouble(Double.parseDouble(correctNumberFormat(value)) / 100);
      }
      return result;
   }
889302
public void putString(String value)
    {
        if (value.length() > Byte.MAX_VALUE * 2 + 1) {
            putLongString(value);
        }
        else {
            putShortString(value);
        }
    }
1165865
public static String sqrt(String value) {
        try {
            BigDecimal bd = new BigDecimal(value);
            return Math.sqrt(bd.doubleValue()) + "";
        } catch (Exception ex) {
            return null;
        }
    }
845618
public static final Integer parseInteger(String value)
   {
      return (value == null || value.length() == 0 ? null : Integer.valueOf(Integer.parseInt(value)));
   }