Interface SerializationSupport

    • Method Detail

      • writeReplace

        default Object writeReplace()
                             throws ObjectStreamException
        Designate an alternative object to be used when writing an object to the buffer.

        This method is invoked by the Serializer if the object implements SerializationSupport interface.

        Returns:
        an object which state should be written instead of the original one
        Throws:
        ObjectStreamException
      • readResolve

        default Object readResolve()
                            throws ObjectStreamException
        Designate a replacement for an object after an instance of it is read from the buffer.

        This method is invoked by the Serializer if the object implements SerializationSupport interface.

        Returns:
        an object that should be returned instead of the deserialized one
        Throws:
        ObjectStreamException