CavalliumDBEngine/src/main/java/it/cavallium/dbengine/database/remote/LLSnapshotSerializer.java

22 lines
663 B
Java
Raw Normal View History

2022-03-02 12:34:30 +01:00
package it.cavallium.dbengine.database.remote;
import it.cavallium.data.generator.DataSerializer;
import it.cavallium.dbengine.database.LLSnapshot;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.jetbrains.annotations.NotNull;
public class LLSnapshotSerializer implements DataSerializer<LLSnapshot> {
@Override
public void serialize(DataOutput dataOutput, @NotNull LLSnapshot llSnapshot) throws IOException {
dataOutput.writeLong(llSnapshot.getSequenceNumber());
}
@Override
public @NotNull LLSnapshot deserialize(DataInput dataInput) throws IOException {
return new LLSnapshot(dataInput.readLong());
}
}