Esempio n. 1
0
 /**
  * Create an independent copy of this temporary value. The file will not be deleted automatically.
  *
  * @return the value
  */
 @Override
 public ValueLob copyToTemp() {
   ValueLob lob;
   if (type == CLOB) {
     lob = ValueLob.createClob(getReader(), precision, handler);
   } else {
     lob = ValueLob.createBlob(getInputStream(), precision, handler);
   }
   return lob;
 }
Esempio n. 2
0
 @Override
 public Value convertPrecision(long precision, boolean force) {
   if (this.precision <= precision) {
     return this;
   }
   ValueLob lob;
   if (type == CLOB) {
     lob = ValueLob.createClob(getReader(), precision, handler);
   } else {
     lob = ValueLob.createBlob(getInputStream(), precision, handler);
   }
   return lob;
 }
Esempio n. 3
0
 /**
  * Convert a lob to another data type. The data is fully read in memory except when converting to
  * BLOB or CLOB.
  *
  * @param t the new type
  * @return the converted value
  */
 @Override
 public Value convertTo(int t) {
   if (t == type) {
     return this;
   } else if (t == Value.CLOB) {
     ValueLob copy = ValueLob.createClob(getReader(), -1, handler);
     return copy;
   } else if (t == Value.BLOB) {
     ValueLob copy = ValueLob.createBlob(getInputStream(), -1, handler);
     return copy;
   }
   return super.convertTo(t);
 }