if (type == byte[].class) {
byte[] valueArray = (byte[]) value;
try {
return new String(valueArray, 0, valueArray.length, JoddCore.encoding);
} catch (UnsupportedEncodingException ueex) {
throw new TypeConversionException(ueex);
}
}
if (type == char[].class) {
char[] charArray = (char[]) value;
return new String(charArray);
}
return CsvUtil.toCsvString((Object[])value);
}
if (value instanceof Clob) {
Clob clob = (Clob) value;
try {
long length = clob.length();
if (length > Integer.MAX_VALUE) {
throw new TypeConversionException("Clob is too big.");
}
return clob.getSubString(1, (int) length);
} catch (SQLException sex) {
throw new TypeConversionException(value, sex);
}
}
return value.toString();
}