Class SerializedWrapper<T>

  • All Implemented Interfaces:
    java.io.Serializable

    public class SerializedWrapper<T>
    extends java.lang.Object
    implements java.io.Serializable
    A wrapper for a preserialized object. Helps to avoid double serialization. The wrapper automatically unpacks the original object during deserialization.
    See Also:
    Serialized Form
    • Field Detail

      • serialized

        private final byte[] serialized
    • Constructor Detail

      • SerializedWrapper

        public SerializedWrapper​(byte[] serialized)
    • Method Detail

      • getSerialized

        public byte[] getSerialized()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • wrap

        public static <T> SerializedWrapper<T> wrap​(T object)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • unwrap

        public T unwrap()
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException