}
} catch (Exception e) {
String msg = "Error while storing blob. id="
+ state.getId() + " idx=" + i + " size=" + size;
log.error(msg, e);
throw new IOExceptionWithCause(msg, e);
}
try {
// replace value instance with value
// backed by resource in blob store and delete temp file
if (blobStore instanceof ResourceBasedBLOBStore) {
values[i] = InternalValue.create(((ResourceBasedBLOBStore) blobStore).getResource(blobId));
} else {
values[i] = InternalValue.create(blobStore.get(blobId));
}
} catch (Exception e) {
log.error("Error while reloading blob. truncating. id="
+ state.getId() + " idx=" + i + " size=" + size, e);
values[i] = InternalValue.create(new byte[0]);
}
val.discard();
}
// store id of blob as property value
writeString(blobId); // value
} else {
// delete evt. blob
byte[] data = writeSmallBinary(val, state, i);
// replace value instance with value
// backed by resource in blob store and delete temp file
values[i] = InternalValue.create(data);
val.discard();
}
} catch (RepositoryException e) {
String msg = "Error while storing blob. id="
+ state.getId() + " idx=" + i + " value=" + val;
log.error(msg, e);
throw new IOExceptionWithCause(msg, e);
}
break;
case PropertyType.DOUBLE:
try {
out.writeDouble(val.getDouble());