org.erights.e.elib.serial
Class SerializationStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.ObjectOutputStream
              |
              +--org.erights.e.elib.serial.SerializationStream
All Implemented Interfaces:
DataOutput, ObjectOutput, ObjectStreamConstants

public final class SerializationStream
extends ObjectOutputStream

Untamed:


Field Summary
private  Replacer myReplacer
           
 
Fields inherited from class java.io.ObjectOutputStream
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, 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_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
(package private) SerializationStream(OutputStream out, Replacer replacer)
          Makes SerializationStream specialized by 'replacer'.
 
Method Summary
protected  Object replaceObject(Object ref)
          returns the Ref.resolution(Object) of replacer(ref)
 
Methods inherited from class java.io.ObjectOutputStream
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
writeWholeNum
 

Field Detail

myReplacer

private final Replacer myReplacer
Constructor Detail

SerializationStream

SerializationStream(OutputStream out,
                    Replacer replacer)
              throws IOException
Makes SerializationStream specialized by 'replacer'.

Makes an ObjectOutputStream on out with the following differences:

replacer(..) is used as the overriding of .replaceObject(..). See the Java Serialization spec for the detailed implications of this.

Method Detail

replaceObject

protected Object replaceObject(Object ref)
returns the Ref.resolution(Object) of replacer(ref)

Overrides:
replaceObject in class ObjectOutputStream
Parameters:
ref - the object to be replaced
Returns:
the alternate object that replaced the specified one


comments?