@Override public Value convertPrecision(long precision, boolean force) { if (this.precision <= precision) { return this; } ValueLob lob; if (type == CLOB) { lob = ValueLob.createClob(getReader(), precision); } else { lob = ValueLob.createBlob(getInputStream(), precision); } return lob; }
/** * 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); } else { lob = ValueLob.createBlob(getInputStream(), precision); } return lob; }
/** * 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); return copy; } else if (t == Value.BLOB) { ValueLob copy = ValueLob.createBlob(getInputStream(), -1); return copy; } return super.convertTo(t); }