Class ObjectStreamOut

java.lang.Object
com.github.stephengold.joltjni.ObjectStreamOut

public final class ObjectStreamOut extends Object
Utility class for writing uncooked Jolt-Physics objects to files or streams. Data serialized this way is more like to be compatible with future versions of the library than the saveBinaryState()/restoreBinaryState() methods.
See Also:
  • Method Details

    • sWriteObject

      public static boolean sWriteObject(String fileName, EStreamType streamType, ConstJoltPhysicsObject writeObject)
      Write the specified object to the specified file.
      Parameters:
      fileName - the path to the file (not null)
      streamType - the type of file (not null)
      writeObject - the object to write (not null, unaffected)
      Returns:
      true if successful, otherwise false
    • sWriteObject

      public static boolean sWriteObject(StringStream stream, EStreamType streamType, ConstJoltPhysicsObject writeObject)
      Write the specified object to the specified stream.
      Parameters:
      stream - the stream to write to (not null)
      streamType - the type of stream (not null)
      writeObject - the object to write (not null, unaffected)
      Returns:
      true if successful, otherwise false