private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
SerializableRenderedImage sri;
if (formatName == null ||
encodingParam == null ||
decodingParam == null) {
sri = new SerializableRenderedImage((RenderedImage)theObject,
useDeepCopy);
} else {
sri =
new SerializableRenderedImage((RenderedImage)theObject,
useDeepCopy,
registry,
formatName,
encodingParam,
decodingParam);