code: @Override
    public String format(Object value)
    {
      if(value == null) {
        return "";
      }
  
      double fileSize = 0;
      if(value instanceof Integer) {
        fileSize = (Integer)value;
      }
      else if(value instanceof Long) {
        fileSize = (Long)value;
      }
      else {
        throw new IllegalArgumentException(String.format("Invalid argument type |%s|.", value.getClass()));
      }
  
      if(fileSize == 0) {
        return format(0, Units.B);
      }
      Units units = Units.B;
      for(Units u : Units.values()) {
        if(fileSize < u.value) {
          break;
        }
        units = u;
      }
      return format(fileSize / units.value, units);
    }
docs: Format a integer or long value as file size. Returns empty string if <code>value</code> argument is null.
  
  @param value numeric value.
  @return numeric value represented as file size, possible empty if <code>value</code> argument is null.
  @throws IllegalArgumentException if <code>value</code> argument is not integer or long.