SerializedBytes
Keywords: net.corda.core.serialization.SerializedBytes class
Date: 2023-09-18

net.corda.core.serialization

## Class SerializedBytes<T>

- net.corda.core.utilities.ByteSequence
- - net.corda.core.utilities.OpaqueBytes
  - - net.corda.core.serialization.SerializedBytes<T>

-     public class SerializedBytes<T>
      extends OpaqueBytes

  A type safe wrapper around a byte array that contains a serialised object. You can call SerializedBytes.deserialize to get the original object back.

- - ### Field Detail

    - #### Companion

          public static net.corda.core.serialization.SerializedBytes.Companion Companion

  - ### Constructor Detail

    - #### SerializedBytes

          public SerializedBytes(@NotNull
                                 kotlin.Array[] bytes)

      A type safe wrapper around a byte array that contains a serialised object. You can call SerializedBytes.deserialize to get the original object back.

  - ### Method Detail

    - #### getHash

          @NotNull
          public SecureHash getHash()

    - #### from

          @JvmStatic
           @JvmOverloads
           @NotNull
          public static <T> SerializedBytes<T> from(@NotNull
                                                                                        T obj,
                                                                                        @NotNull
                                                                                        SerializationFactory serializationFactory,
                                                                                        @NotNull
                                                                                        SerializationContext context)

      Serializes the given object and returns a `class SerializedBytes` wrapper for it. An alias for `Any.serialize` intended to make the calling smoother for Java users.

      See Also:
        `class SerializedBytes`, `Any.serialize`

    - #### from

          @JvmStatic
           @JvmOverloads
           @NotNull
          public static <T> SerializedBytes<T> from(@NotNull
                                                                                        T obj,
                                                                                        @NotNull
                                                                                        SerializationFactory serializationFactory)

      Serializes the given object and returns a `class SerializedBytes` wrapper for it. An alias for `Any.serialize` intended to make the calling smoother for Java users.

      See Also:
        `class SerializedBytes`, `Any.serialize`

    - #### from

          @JvmStatic
           @JvmOverloads
           @NotNull
          public static <T> SerializedBytes<T> from(@NotNull
                                                                                        T obj)

      Serializes the given object and returns a `class SerializedBytes` wrapper for it. An alias for `Any.serialize` intended to make the calling smoother for Java users.

      See Also:
        `class SerializedBytes`, `Any.serialize`