if(isValid(SAMPLE_MODEL_MASK)) {
Object object = in.readObject();
if (!(object instanceof SerializableState))
sampleModel = null;
SerializableState ss = (SerializableState)object;
Class c = ss.getObjectClass();
if (SampleModel.class.isAssignableFrom(c))
sampleModel = (SampleModel)ss.getObject();
else
sampleModel = null;
}
// Read the serializable form of the ColorModel.
if(isValid(COLOR_MODEL_MASK)) {
Object object = in.readObject();
if (!(object instanceof SerializableState))
colorModel = null;
SerializableState ss = (SerializableState)object;
Class c = ss.getObjectClass();
if (ColorModel.class.isAssignableFrom(c))
colorModel = (ColorModel)ss.getObject();
else
colorModel = null;
}
}