Package com.github.stephengold.joltjni
Class StateRecorderImpl
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.StateRecorder
com.github.stephengold.joltjni.StateRecorderImpl
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
Full implementation of
StateRecorder
, using stringstream
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
Read binary data.void
writeBytes
(byte[] data) Write binary data.void
writeBytes
(byte[] data, int numBytes) Write binary data.Methods inherited from class com.github.stephengold.joltjni.StateRecorder
isValidating, readBodyIdVector, readBoolean, readFloat, readInt, readRMat44, readRVec3, readString, readVec3, setValidating, write, write, write, write, write, write, write, write
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
StateRecorderImpl
public StateRecorderImpl()Instantiate a recorder.
-
-
Method Details
-
getData
public byte[] getData()Read binary data.- Returns:
- the bytes that were read
-
writeBytes
public void writeBytes(byte[] data) Write binary data.- Parameters:
data
- the bytes to write (not null, unaffected)
-
writeBytes
public void writeBytes(byte[] data, int numBytes) Write binary data.- Parameters:
data
- the bytes to write (not null, unaffected)numBytes
- the number of byte to write (≥0)
-