public class EObjectOutputStream
extends java.io.ObjectOutputStream
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 |
---|
EObjectOutputStream(java.io.OutputStream out,
EDatabase database) |
Modifier and Type | Method and Description |
---|---|
EDatabase |
getDatabase() |
IdManager |
getIdManager() |
protected java.lang.Object |
replaceObject(java.lang.Object obj)
This method will allow trusted subclasses of ObjectOutputStream to
substitute one object for another during serialization.
|
annotateClass, annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeStreamHeader, writeUnshared, writeUTF
public EObjectOutputStream(java.io.OutputStream out, EDatabase database) throws java.io.IOException
java.io.IOException
public EDatabase getDatabase()
public IdManager getIdManager()
protected java.lang.Object replaceObject(java.lang.Object obj) throws java.io.IOException
The ObjectOutputStream.writeObject method takes a parameter of type Object (as opposed to type Serializable) to allow for cases where non-serializable objects are replaced by serializable ones.
When a subclass is replacing objects it must insure that either a complementary substitution must be made during deserialization or that the substituted object is compatible with every field where the reference will be stored. Objects whose type is not a subclass of the type of the field or array element abort the serialization by raising an exception and the object is not be stored.
This method is called only once when each object is first encountered. All subsequent references to the object will be redirected to the new object. This method should return the object to be substituted or the original object.
Null can be returned as the object to be substituted, but may cause NullReferenceException in classes that contain references to the original object since they may be expecting an object instead of null.
replaceObject
in class java.io.ObjectOutputStream
obj
- the object to be replacedjava.io.IOException
- Any exception thrown by the underlying
OutputStream.