Class TransientInjectableObjectOutputStream

java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
com.vaadin.kubernetes.starter.sessiontracker.serialization.SerializationOutputStream
com.vaadin.kubernetes.starter.sessiontracker.serialization.TransientInjectableObjectOutputStream
All Implemented Interfaces:
Closeable, DataOutput, Flushable, ObjectOutput, ObjectStreamConstants, AutoCloseable

public class TransientInjectableObjectOutputStream extends SerializationOutputStream
An ObjectOutputStream implementation that adds to the binary stream information about transient fields that can potentially be injected on deserialization. It inspects instances of classes to get information about transient fields and related instance identifiers. When injectable transient candidates are detected, an object holding transient field details and a reference to the current instance is written into the stream. This object will then be used during deserialization to try to automatically inject values into transient fields of the deserialized object. Object inspection if performed by a pluggable TransientHandler object whose aim is to provide information about transient fields along with an object identifier for the instance being serialized, in the form of TransientDescriptor objects. To improve performance, a filter can be provided to inspect only classes known to have injectable transient fields. For example inspection can be restricted to only some packages. Classes from Java Platform are excluded regardless of the configured filters.
 
 new TransientInjectableObjectOutputStream(os, handler,
         type -> type.getPackageName().startsWith("com.vaadin.app"))
         .writeWithTransients(target);
 
 
Output of this class is meant to be read by TransientInjectableObjectInputStream.
See Also: