private ValueLob(DataHandler handler, Reader in, long remaining) throws IOException {
this.type = Value.CLOB;
this.handler = handler;
this.small = null;
this.lobId = 0;
this.hmac = null;
this.fileName = createTempLobFileName(handler);
this.tempFile = this.handler.openFile(fileName, "rw", false);
this.tempFile.autoDelete();
FileStorageOutputStream out = new FileStorageOutputStream(tempFile, null, null);
long tmpPrecision = 0;
try {
char[] buff = new char[Constants.IO_BUFFER_SIZE];
while (true) {
int len = getBufferSize(this.handler, false, remaining);
len = IOUtils.readFully(in, buff, len);
if (len == 0) {
break;
}
}
} finally {
out.close();
}
this.precision = tmpPrecision;
}