Klasse ObjectToBytesExtensions

java.lang.Object
io.github.astrapisixtynine.fury.ObjectToBytesExtensions

public class ObjectToBytesExtensions extends Object
Utility class for converting Java objects to byte arrays
  • Konstruktordetails

    • ObjectToBytesExtensions

      public ObjectToBytesExtensions()
  • Methodendetails

    • toBytes

      public static <T> byte[] toBytes(@NonNull T object, Class<?>... registerClasses)
      Converts an object to a byte array
      Typparameter:
      T - the type of the object to be serialized
      Parameter:
      object - the object to be serialized
      registerClasses - classes that need to be registered for serialization
      Gibt zurück:
      the serialized byte array
    • toBytes

      public static <T> byte[] toBytes(@NonNull @NonNull org.apache.fury.Fury fury, @NonNull T object, Class<?>... registerClasses)
      Converts an object to a byte array using a specific Fury instance
      Typparameter:
      T - the type of the object to be serialized
      Parameter:
      fury - the Fury instance used for serialization
      object - the object to be serialized
      registerClasses - classes that need to be registered for serialization
      Gibt zurück:
      the serialized byte array