/*
Converts clob to string
503699
private static String clobToString(Clob clob) {
        Reader r = null;
        StringWriter sw = null;
        try {
            r = clob.getCharacterStream();
            sw = new StringWriter();
            copyStream(r, sw);
            return sw.toString();
        } catch (Exception e) {
            throw new ConversionException(e);
        } finally {
            closeQuietly(sw);
            closeQuietly(r);
        }
    }
1249251
function amf0decLongString(buf) {
    var sLen = buf.readUInt32BE(1);
    return { len: 5 + sLen, value: buf.toString('utf8', 5, 5 + sLen) }
}
1077886
private String safeToString(Object obj)
	{
		String toString = null;
		if (obj != null)
		{
		    try
		    {
		        toString = obj.toString();
		    }
		    catch (Throwable ex)
		    {
		        toString = "BAD toString() impl for " + obj.getClass().getName();
		    }
		}
		return toString;
	}
255467
function parseCover(str) {
    str = str.split(EOL);
    var obj = {};
    var reg = /(\w+)\s?:\s?(.+)/;
    str.forEach(function(val) {
        if (val = reg.exec(val)) {
            obj[val[1]] = val[2];
        }
    });
    return obj;
}
706471
public static String convertToClob(final String varchar) {
      int startIndex = 0;
      int endIndex = Math.min(startIndex + 4000, varchar.length());
      final StringBuilder clobs = new StringBuilder("TO_CLOB('").append(
            varchar.substring(startIndex, endIndex)).append("')");
      while (endIndex < varchar.length()) {
         startIndex = endIndex;
         endIndex = Math.min(startIndex + 4000, varchar.length());
         clobs.append(" || TO_CLOB('").append(varchar.substring(startIndex, endIndex)).append("')");
      }
      return clobs.toString();
   }
864744
function parseString(opts) {
    var obj = new Obj();

    opts.split(' ').forEach(function (item) {
        var data = splitByColon(item);
        obj[data.key] = data.val;
    });

    return obj;
}
583937
@Override
    public final String readObjectB(final Class clazz) {
        char ch = nextGoodChar();
        if (ch == '{') return "";
        if (ch == 'n' && nextChar() == 'u' && nextChar() == 'l' && nextChar() == 'l') return null;
        if (ch == 'N' && nextChar() == 'U' && nextChar() == 'L' && nextChar() == 'L') return null;
        StringBuilder sb = new StringBuilder();
        sb.append(ch);
        char one;
        try {
            while ((one = nextChar()) != 0) sb.append(one);
        } catch (Exception e) {
        }
        throw new ConvertException("a json object text must begin with '{' (position = " + position + ") but '" + ch + "' in (" + sb + ")");
    }
916713
function str2obj(str) {
  if (!str) {
    return {};
  }

  return str.split('&').reduce(function (acc, cur) {
    var _cur$split = cur.split('='),
        _cur$split2 = _slicedToArray(_cur$split, 2),
        k = _cur$split2[0],
        v = _cur$split2[1];

    k = decodeURIComponent(k);
    v = decodeURIComponent(v);
    return _extends({}, acc, _defineProperty({}, k, v));
  }, {});
}
432164
public String binaryToString(Object objData) 
    {
        initGlobals();
        if (objData == null)
            return Constants.BLANK;
        String string = null;
        synchronized (gNumberFormat)
        {
            if (m_ibScale != 2)
            {
                gNumberFormat.setMinimumFractionDigits(m_ibScale);
                gNumberFormat.setMaximumFractionDigits(m_ibScale);
            }
            string = gNumberFormat.format(((Double)objData).doubleValue());
            if (m_ibScale != 2)
            {
                gNumberFormat.setMinimumFractionDigits(2);
                gNumberFormat.setMaximumFractionDigits(2);
            }
        }
        return string;
    }
588299
public static String asString(Object o) {
        if (o == null) {
            return NULL;
        } else if (o instanceof Stringable) {
            return ((Stringable) o).asString();
        } else if (o instanceof Numeric) {
            return String.format("%d", ((Numeric) o).asInteger());
        } else if (o instanceof CharSequence) {
            return String.format("\"%s\"", escape((CharSequence) o));
        } else if (o instanceof Double) {
            return asString(((Double) o).doubleValue());
        } else if (o instanceof Collection) {
            return asString((Collection<?>) o);
        } else if (o instanceof Map) {
            return asString((Map<?, ?>) o);
        } else {
            return o.toString();
        }
    }
426971
String convertToString(Object value) {
        if (value == null) {
            return null;
        } else if (value instanceof String) {
            return (String) value;
        } else if (value instanceof List) {
            List<?> list = ((List<?>) value);
            if (list.size() == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (list.size() == 1) {
                String strValue = String.valueOf(list.get(0));
                return escapeValue(strValue);
            } else {
                StringBuilder builder = new StringBuilder();
                Iterator<?> iterator = list.iterator();
                while (iterator.hasNext()) {
                    String strValue = String.valueOf(iterator.next());
                    strValue = escapeValue(strValue);
                    builder.append(strValue);
                    if (iterator.hasNext()) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else if (value instanceof String[]) {
            String[] array = (String[]) value;
            if (array.length == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (array.length == 1) {
                return escapeValue(array[0]);
            } else {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < array.length; i++) {
                    String strValue = escapeValue(array[i]);
                    builder.append(strValue);
                    if (i + 1 < array.length) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else if (value.getClass().isArray()) {
            int size = Array.getLength(value);
            if (size == 0) {
                return EvaluationContext.EMPTY_STRING;
            } else if (size == 1) {
                String strValue = String.valueOf(Array.get(value, 0));
                return escapeValue(strValue);
            } else {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < size; i++) {
                    String strValue = String.valueOf(Array.get(value, i));
                    strValue = escapeValue(strValue);
                    builder.append(strValue);
                    if (i + 1 < size) {
                        builder.append(", ");
                    }
                }
                return builder.toString();
            }
        } else {
            return value.toString();
        }
    }
578728
function convertStrItems2Obj(obj) {
	var result = {};
	for (var key in obj) {
		var val = obj[key];
		val = extractTypeAndCast(val);
		convertStrItem2Obj(key, val, result);
	}

	return result;
}
44809
public String objectToString(Object object) {
        DimIProxy action = new DimIProxy(this, IPROXY_OBJECT_TO_STRING);
        action.object = object;
        action.withContext();
        return action.stringResult;
    }
243159
function stringifySync(obj) {
	var output = "";
	var firstOccur = true;

	Object.keys(obj).forEach(function (key) {
		if (typeof obj[key] === "string") {
			output += key + "=" + obj[key];
			output += os.EOL;
		} else {
			if (firstOccur) {
				firstOccur = false;
			} else {
				output += os.EOL;
			}

			output += "[" + key + "]";
			output += os.EOL;
			Object.keys(obj[key]).forEach(function (innerKey) {
				var value = obj[key][innerKey];
				if (typeof value === "string") {
					// if value can ber converted to number or boolean,
					// but it should be a string,
					// so keep the quotes to indicate its type
					if (!isNaN(value) || value.toLowerCase() === "true" || value.toLowerCase() === "false") {
						value = "\"" + value + "\"";
					}
				}

				output += innerKey + "=" + value;
				output += os.EOL;
			});
		}
	});

	return output;
}
904930
function strToBoolean(str) {
    switch (str && str.toLowerCase && str.toLowerCase()) {
        case 'true':
            return true;
        case 'false':
            return false;
        case 'null':
            return null;
    }
    return undefined;
}
1328340
function arrayToStr(key, value) {
  if (isString(value) || isNumber(value)) return `${key}=${value}`;
  if (isString(value[0])) return `${key}=${value.join(':')}`;
  if (value && value.toString) return `${key}=${value.toString()}`;

  return value.map(val => arrayToStr(key, val));
}
1060740
function bin2String(array) {
  var result = "";
  for (var i = 0; i < array.length; i++) {
    result += String.fromCharCode(array[i]);
  }
  return result;
}