public final class XMLObjectInputStream
extends java.io.ObjectInputStream
This purpose of this class is to provide compatibility for applications between different versions of the XDK for Java, with regards to serialization and deserialization. If an XML document (using the DOM model) has been serialized with a version of the XDK for Java of 11.2.0.1 or earlier, and you want to deserialize it with a version of 11.2.0.2 or later, then you may have to use this class to do so. You will know that you must do so if you encounter java.io.InvalidClassException
during deserialization, with an error message that indicates that the serialVersionUID
is incompatible between the stream classdesc
and the local class
.
Serialization is typically done with java.io.ObjectOutputStream.writeObject(doc)
; and deserialization with java.io.ObjectInputStream.readObject()
. This class extends the standard Java class ObjectInputStream
so as to preserve compatibility.
If your application previously did deserialization by using code such as the following:
import java.io.* ;
import oracle.xml.parser.v2.* ;
InputStream is = new FileInputStream( new File( "abc.dat" ) ) ;
ObjectInputStream ois = new ObjectInputStream( is ) ;
Object o = ois.readObject() ;
XMLDocument xdoc = (XMLDocument) o ;
and you get the InvalidClassException
during deserialization (i.e., in the readObject()
method); then you may have to replace the constructor for ObjectInputStream
with XMLObjectInputStream
in your application:
ObjectInputStream ois = new XMLObjectInputStream( is ) ;
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
Constructor and Description |
---|
XMLObjectInputStream(java.io.InputStream in) |
available, close, defaultReadObject, read, read, readBoolean, readByte, readChar, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readShort, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, skipBytes