Class SerializableUtils


  • public final class SerializableUtils
    extends java.lang.Object
    • Method Detail

      • toByteArray

        public static byte[] toByteArray​(java.lang.Object obj)
                                  throws java.io.NotSerializableException
        Throws:
        java.io.NotSerializableException
      • toByteArray

        public static byte[] toByteArray​(java.lang.Object obj,
                                         Indirector indirector,
                                         IndirectPolicy policy)
                                  throws java.io.NotSerializableException
        Throws:
        java.io.NotSerializableException
      • serializeToByteArray

        public static byte[] serializeToByteArray​(java.lang.Object obj)
                                           throws java.io.NotSerializableException
        Deprecated.
        use SerialializableUtils.toByteArray() [shorter name is better!]
        Throws:
        java.io.NotSerializableException
      • fromByteArray

        public static java.lang.Object fromByteArray​(byte[] bytes)
                                              throws java.io.IOException,
                                                     java.lang.ClassNotFoundException
        By default, unwraps IndirectlySerialized objects, returning the original
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • fromByteArray

        public static java.lang.Object fromByteArray​(byte[] bytes,
                                                     boolean ignore_indirects)
                                              throws java.io.IOException,
                                                     java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • deserializeFromByteArray

        public static java.lang.Object deserializeFromByteArray​(byte[] bytes)
                                                         throws java.io.IOException,
                                                                java.lang.ClassNotFoundException
        Deprecated.
        use SerialializableUtils.fromByteArray() [shorter name is better!]
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • testSerializeDeserialize

        public static java.lang.Object testSerializeDeserialize​(java.lang.Object o)
                                                         throws java.io.IOException,
                                                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • deepCopy

        public static java.lang.Object deepCopy​(java.lang.Object o)
                                         throws java.io.IOException,
                                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • unmarshallObjectFromFile

        public static final java.lang.Object unmarshallObjectFromFile​(java.io.File file)
                                                               throws java.io.IOException,
                                                                      java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • marshallObjectToFile

        public static final void marshallObjectToFile​(java.lang.Object o,
                                                      java.io.File file)
                                               throws java.io.IOException
        Throws:
        java.io.IOException