* Set the value from an non-null Java.sql.Clob object.
*/
final void setObject(Object theValue)
throws StandardException
{
Clob vc = (Clob) theValue;
try {
long vcl = vc.length();
if (vcl < 0L || vcl > Integer.MAX_VALUE)
throw this.outOfRange();
// For small values, just materialize the value.
// NOTE: Using streams for the empty string ("") isn't supported
// down this code path when in soft upgrade mode, because the code
// reading the header bytes ends up reading zero bytes (i.e., it
// doesn't get the header / EOF marker).
if (vcl < 32*1024) {
setValue(vc.getSubString(1, (int)vcl));
} else {
ReaderToUTF8Stream utfIn = new ReaderToUTF8Stream(
vc.getCharacterStream(), (int) vcl, 0, TypeId.CLOB_NAME,
getStreamHeaderGenerator());
setValue(utfIn, (int) vcl);
}
} catch (SQLException e) {
throw dataTypeConversion("DAN-438-tmp");