//
EventBroadcaster broadcaster = state.getSession().broadcaster;
//
if (o instanceof InputStream && broadcaster.hasStateChangeListeners()) {
CopyingInputStream in = new CopyingInputStream((InputStream)o);
state.setPropertyValue(propertyName, type, in);
byte[] bytes = in.getBytes();
broadcaster.propertyChanged(object, propertyName, new CloneableInputStream(bytes));
} else {
state.setPropertyValue(propertyName, type, o);
broadcaster.propertyChanged(object, propertyName, o);
}