throw new DataStoreException(msg);
}
temporaryInUse.add(tempId);
MessageDigest digest = getDigest();
DigestInputStream dIn = new DigestInputStream(stream, digest);
TrackingInputStream in = new TrackingInputStream(dIn);
StreamWrapper wrapper;
if (STORE_SIZE_MINUS_ONE.equals(storeStream)) {
wrapper = new StreamWrapper(in, -1);
} else if (STORE_SIZE_MAX.equals(storeStream)) {
wrapper = new StreamWrapper(in, Integer.MAX_VALUE);
} else if (STORE_TEMP_FILE.equals(storeStream)) {
File temp = moveToTempFile(in);
fileInput = new TempFileInputStream(temp);
long length = temp.length();
wrapper = new StreamWrapper(fileInput, length);
} else {
throw new DataStoreException("Unsupported stream store algorithm: " + storeStream);
}
// UPDATE DATASTORE SET DATA=? WHERE ID=?
conHelper.exec(updateDataSQL, new Object[]{wrapper, tempId});
now = System.currentTimeMillis();
long length = in.getPosition();
DataIdentifier identifier = new DataIdentifier(digest.digest());
usesIdentifier(identifier);
id = identifier.toString();
// UPDATE DATASTORE SET ID=?, LENGTH=?, LAST_MODIFIED=?
// WHERE ID=?